Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I'm trying to create a situation where if a bar meets a certain condition it gets painted red, however, if the bar following it fails to meet another condition, the initial bar gets re-painted dark red.
Historical is only true while backtesting or while a chart is being loaded/drawn for the first time after you open it. It is not true once it is fully loaded.
That said, I can't help with how to paint backwards on the price bars - don't have ninja installed anymore - but as for making an indicator repaint all you do is modify the array 1 bar back, like:
myArray[1] = newValue;
Probably similar for price bars. Hopefully someone can help.
I did not answer this in the first place because several things are confused. So let me summarize:
-> BarColor will only paint the current bar, you cannot use it to paint back.
-> "Historical" cannot be used this way. "Historical" refers to historical data as stored in the historical data base.If you connect to a data provider, typically NinjaTrader will backfill historical data for the time prior to connection and then collect real-time data. The previous bar, which you wanted to paint, can therefore be a real-time data bar. The use you made of "Historical" does not make any sense.
-> As @bukkan pointed out, if you want to reference the previous value of a BoolSeries, it would be BoolSeries[1], Boolseries[-1] will likely throw an out of range exception as the value has not been set.
I define a Marubozu bar with a certain set of parameters. If the current bar meets those requirements, it gets painted green if it is an up bar or red if it is a down bar. However, the following bar is the confirmation bar. If it doesn't show sufficient follow through as defined by another set of parameters, then the initial Marubozu bar has 'failed' and that bar gets repainted a darker shade to show that status.
"-1" was used on purpose to refer to the next bar (confirmation bar), not the last bar.
The code was supposed to work like this: If this is the current bar, and it meets my definition of Marubozu, paint it red or green. However, if it is not the current bar, but it meets my definition of Marubozu, check the next bar and see if it has been confirmed. If it hasn't been confirmed, paint it the darker shade.
-> BarColor will only paint the current bar, you cannot use it to paint back.
I assume this means I cannot do what I would like to do as described above?