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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        43 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        20 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        30 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        47 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        38 views
        0 likes
        Last Post CarlTrading  
        Working...
        X