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!
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
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.
-
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.BertrandNinjaTrader Customer Service
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.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Brevo, Today, 01:45 AM
|
0 responses
2 views
0 likes
|
Last Post
by Brevo
Today, 01:45 AM
|
||
Started by aussugardefender, Today, 01:07 AM
|
0 responses
3 views
0 likes
|
Last Post Today, 01:07 AM | ||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
238 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
384 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
||
Started by oviejo, Today, 12:28 AM
|
0 responses
4 views
0 likes
|
Last Post
by oviejo
Today, 12:28 AM
|
Comment