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)
Why would the bar end result be different on a plot if running COBC true vs COBC false?
We are talking WMAs, EMAs here. Since the last tick will always replace prior intrabar tick results, the final input values should be the same. So seems to me that the outputs should also be the same.
I am having trouble wrapping my head around the thought that the outputs are different given the same inputs.
I feel like I am missing something obvious (wouldn't be the first time!)
Can you help answer these questions from other members on NexusFi?
For all properly coded indicator the end result will be identical. If set to CalcOnBarClose = false, NinjaTrader indicators will display intermediary values based on the temporary input values of price and volume. Once the bar is completed the indicator set to CalcOnBarClose=true will display the same result.
The only difference is that in CalcOnBarClose = false the unstable (unfinished) period is displayed, whereas for CalcOnBarClose = true it is not displayed, which makes up for an empty space instead of the indicator value.
If you are offline, NinjaTrader considers the last bar as incomplete, so the indicator may not show any value yet.
OK, could it be that the COBC true indicator was put on the chart from a Strategy and the COBC false was (already) placed on the chart through the Indicator panel? I cringe to think a Strategy will receive different values....
But I already know that code I write in a Indicator behaves differently when written in a Strategy.
That's what I have been working through the last few days.
P.S. I found the suspect code - the smoothing algorithm I was given to use will definitely not be the same intrabar vs EOB. Ah well, it will give me something to think about along woth the other stuff I am not getting done because I keep reading the forum.
If CalcOnBarClose=false does not produce the same value in the end as CalcOnBarClose = true, it indicates that the indicator code is flawed, because the author has not understood which (iterating) calculations shall be only calculated when FirstTickOfBar is true, and which calculations can be performed with every incoming tick.
Note that historical bars have only 1 tick per bar, while real-time bars typically have many ticks per bar.
NT strategies always operate on COBC true, there is no other option. You have to code a MTF strategy to get around that.
Most common problem people see with COBC false indicators is 'false' alerts, or alerts that occur or trigger when it is "false" that would not be shown later if the chart was refreshed. This is because:
1. In realtime, COBC false, a condition may happen intrabar that is no longer true at the end of bar. If your indicator does something intrabar, like draw an arrow, then unless you specifically add code to remove false arrows that arrow will remain even if at the end of the bar the condition is no longer true.
2. NT charts are built on historical data when loaded, and historical data is calculated only as COBC true. It is not possible to load a new chart and have the indicator values constructed as if COBC false was set on historical bars. This is a NT limitation.
MTF? I know when backtesting or optimizing, COBC will be true. But when running a strategy real-time on a chart, there is an option to change COBC. I would expect this to control more than simply the embedded indicators...
Yes, I expect and code for these. Programming for accurate results for both COBC true, COBC false, and Historical has always keep NT life interesting. Thanks for the input!