Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

change background color when ADX is below a specified value

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

    change background color when ADX is below a specified value

    Would like to have the panel background color change to green when the ADX below 25, panel reverts back to default color when ADX is above 25.

    I have 0 programming experience. but I found this indicator https://ninjatraderecosystem.com/use...trend-regions/ It looks like what I'm trying to do but totally reverse. this indicator paint no color when ADX is below minimum value.

    Anyone could help me how to modify this indicator to make it does what I need?​

    #2
    Hello ESHunter,

    Below is a link to a support article with helpful resources on getting started with C# and NinjaScript.


    To set the background color of the bar behind a bar, set the BackBrush property.


    For example:
    if (ADX(20[0] < 30)
    {
    BackBrush = Brushes.Blue;
    }

    If you want to keep setting the brush on future bars after the event of the adx falling below the specified number, use a bool.

    private bool eventOccurred;

    if (ADX(20[0] < 30)
    {
    eventOccurred = true;
    }

    if (eventOccurred == true)
    {
    BackBrush = Brushes.Blue;
    }​
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    599 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    344 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    558 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    557 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X