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 chbruno, 04-24-2024, 04:10 PM
    4 responses
    50 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    10 responses
    398 views
    1 like
    Last Post beobast
    by beobast
     
    Started by lorem, Yesterday, 09:18 AM
    5 responses
    20 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by WHICKED, Today, 12:56 PM
    2 responses
    15 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by Felix Reichert, Today, 02:12 PM
    0 responses
    4 views
    0 likes
    Last Post Felix Reichert  
    Working...
    X