Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access the color property of an indicator in a strategy

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

    Access the color property of an indicator in a strategy

    I have looked around for how to do this, but have been unable to find out how. I have an indicator that I want to use as a filter for a strategy I am building. It is a ma indicator that changes color based on if it is in chop, long bias, or short bias. Is there a way for me to access the color of the plot of a certain bar.
    For example:
    if(indicator()[0] == Color.Blue || indicator()[0] == Color.Green)
    //Place trade
    Any information would be greatly appreciated.

    #2
    Hello laces2,
    Thanks for writing in and I am happy to assist you.

    Yes, you can access the color as long the indicator is plotted on the chart from the initialize section of the strategy (using the Add(MyIndicator() code), and for realtime values only. Please use the below code to do it.

    Code:
    if (MyIndicator().PlotColors[0][1] == Color.Green)
    {
      //do something
    }
    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    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