Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bar color definition / retrieve

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

    Bar color definition / retrieve

    I have a ninja trader indicator. I do not know the source. It colours the candles according to the right logic. I don't have access to indicator plots.
    I would like to make an indicator that determines the colors, which I can develop further in strategy builder. My question is, what script can I use to retrieve the color of a candle?

    In short: i run the original indicator that colors the candles, then run an indicator that determines the colors and plot output (-1,+1). run a strategy that looks at the plot signals and "trades".
    Thx​

    #2
    Hello Weeklyhu,

    Welcome to the NinjaTrader forums!

    You would have to have access to the open source script and set plot values.

    Without the values being set to plots the indicator cannot be used in the Strategy Builder.

    See the guide linked below.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,

      Thank you for your replay!
      What instructions can I use to get the colour of the bar? I cannot find this in the documentation.

      Thx

      Comment


        #4
        Hello Weeklyhu,

        If the Close[0] is greater than the Open[0] the color will be green or the color set for up bars.
        If the Close[0] is less than the Open[0] the color will be red or the color set for down bars.

        The color for the UpBrush can be retrieved with ChartBars.Properties.ChartStyle.UpBrush, and the DownBrush can be retrieved with ChartBars.Properties.ChartStyle.DownBrush.
        Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

        Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
        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
        558 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 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
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X