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:	517
Size:	20.1 KB
ID:	1158001Click image for larger version

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

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

Name:	S 2021-05-28 at 11.47.55 AM.png
Views:	450
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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          576 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X