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 CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        342 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        224 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        198 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        288 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        245 views
        0 likes
        Last Post CarlTrading  
        Working...
        X