Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
CalculateOnBarClose is not updated in Initialize()
Collapse
X
-
CalculateOnBarClose is not updated in Initialize()
I set CalculateOnBarClose to false in Initialize(), However, when I set a break point in OnBarUpdate() and check the value of CalculateOnBarClos, it is still true.Please see attached picture for detail.Tags: None
-
Hello,
Thanks for the note.
The value that is set inside of the settings when you run the indicator/strategy and set it in the parameters this will override this settings.
Also this is an indicator/strategy called from another strategy?
A good role of thumb is to not set this value in Initialize, you will see that in all NinjaTrader indicators we never set this as it needs to always be set by the user as it can cause issues when you start chaining indicators together to run on each other and one is set to COBC = true and the other is set COBC = false.
Let me know if I can be of further assistance.BrettNinjaTrader Product Management
-
Are you running a backtest here as this happens? Then COBC would always be true, as the intrabar formation is not known without any further finer time series added via code:
You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this byLast edited by NinjaTrader_Bertrand; 06-06-2011, 01:44 AM.
Comment
-
This is a backtest strategy to calculate some technical analysis values for securities. In theory, COBC should be set to true. However, if setting COBC to true with connecting Kinetick, it will only do calculation up to yesterday. To get calculation up to today, I have to set COBC to false. Do I misss something?
Comment
-
It's always in backtest. The interesting thing is it is running fine for a few months even I set COBC to false in Initialize(). Suddenly it did not work a couple of days ago. Now I have to set COBC to false in the very beginning of OnBarUpdate() to make it work.
From perspective of coding, I think if I set COBC to false, then it should be false no matter where I set it, right?
Comment
-
Hello,
Can you please the SampleMACrossOver strategy: Does it have the same symptom on your PC? If not we have narrowed it down to the strategy.
You would need to send me code in this case. As not expected, I expect an external factor is causing this however would need more information to further assist.
support at ninjatrader dot com
I look forward to assisting you further.BrettNinjaTrader Product Management
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
566 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
330 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
547 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
548 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|
Comment