Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

BarBrush Question

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

    BarBrush Question

    I am trying to adjust the bar paint on my chart to be able to see things quicker. I would like to have code that say if the current bars highs and lows are between the previous bars highs and lows color the bar the same color as the previous bars. I'm pretty sure I have the if statement part right but can't figure out how to say set the current Brushes to the previous Brushes.

    if((High[0] <= High[1]) && (Low[0] >= Low[0]))
    {

    }

    Any help would be great.

    Thanks

    #2
    Hello Tyler7498,

    Thanks for your post.

    The previous bar color will be defined by a condition that say the Close[1] is greater than the Open[1] (upbar) or the Close[1] is less than the Open[1] (down bar).

    You can pull the data series property of what the upbar color is from: ChartBars.Properties.ChartStyle.UpBrush
    You can pull the data series property of what the downbar color is from: ChartBars.Properties.ChartStyle.DownBrush
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Waxavi, Today, 02:10 AM
    1 response
    16 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by Kaledus, Today, 01:29 PM
    5 responses
    13 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Waxavi, Today, 02:00 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by alifarahani, Today, 09:40 AM
    5 responses
    23 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by gentlebenthebear, Today, 01:30 AM
    3 responses
    17 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X