Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

change background color when ADX rises above a specified value

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    change background color when ADX rises above a specified value

    Would like to have the panel background color change when the ADX rises above a specified value.

    For example, ADX rises above 25, panel background changes to yellow, ADX drops back below 25, panel reverts back to default color.

    Is there any indicator that performs this?



    I found this one https://ninjatraderecosystem.com/use...trend-regions/ which based on the description, I think it sounds similar to what Im trying to do (When ADX is below minimum ADX, no color

    Minimum ADX value is customizable based on your preference. Default is 15.)

    But I couldn't import it as I would get errors that indicate the indicator needs to be update to work on my version of NT (8.0.24.2):



    Click image for larger version

Name:	S 2021-05-28 at 11.45.02 AM.png
Views:	546
Size:	20.1 KB
ID:	1158001Click image for larger version

Name:	S 2021-05-28 at 11.47.44 AM.png
Views:	489
Size:	20.8 KB
ID:	1158002Click image for larger version

Name:	S 2021-05-28 at 11.47.35 AM.png
Views:	492
Size:	21.1 KB
ID:	1158003Click image for larger version

Name:	S 2021-05-28 at 11.47.55 AM.png
Views:	477
Size:	20.3 KB
ID:	1158004


    Alternately, is there a simple way to duplicate/customize the existing ADX indicator to add this functionality? Just want the background color to change once the ADX is above a certain threshold.


    Any help or suggestions would be greatly appreciated. Thank you.




    #2
    Hi John, thanks for your post.

    The "BackBrush" property or "RegionHighlightX" method can be used to modify the chart's background color. It would be easiest to make an indicator that uses the ADX rather than making a copy, but both would be the same performance-wise.

    When you are importing, say "No" to replacing the existing files. To find out what is causing this import to fail you will need to "manually" import it. First, extract the file from the .zip: right-click on the SRS_ADXRegions zip file>Extract All>Extract>Go into the Indicators folder>Copy the entire "Shanta" folder>Paste that folder into Documents\NinjaTrader 8\bin\Custom\Indicators>Go to the NinjaScript Editor and please share the compile error that is displayed.

    Best regards,
    -ChrisL

    Comment


      #3
      Thank you! I imported the file "Indicators\Shanta\ADXRegions.cs: manually, and it worked with no problems / compile errors. Now, this indicator seems to do exactly what I want it to do, but for whatever reason I can only get the background color change effect to appear in Panel 1, and would like to have the effect applied only in Panel 2 (where my ADX resides). I do set the properties to panel 2 but it stays in panel 1. Any suggestions for this?

      Comment


        #4
        Hi John, thanks for your reply.

        In the State.SetDefault section of the code, change DrawOnPricePanel to false to get the drawings on the selected panel.

        Best regards,
        -ChrisL

        Comment


          #5
          Excellent, thanks again.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          68 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          151 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          162 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          100 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          288 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X