View Full Version : Do not work if CalculateOnBarClose = false;
"CJS"
09-06-2010, 07:03 AM
Hi I have a simple breakout strategy that whenever I set CalculateOnBarClose = false do not show any trades. If I set CalculateOnBarClose = true, is working ok.
The chart I am usun is a 150 last tick chart.
Can anybody give a clue about wha´s happening.
Thanls a lot.
NinjaTrader_Bertrand
09-06-2010, 07:10 AM
Do you reference a bar more back in your conditions if CalculateOnBarClose is false?
What indicators are you referencing in this strategy?
"CJS"
09-06-2010, 07:15 AM
Well, this problenm is solved.
I have e new question.
Even though I am using CalculateOnBarClose = false, the market orders are being triggeredin the next open.
Is this normal?
I thought that on a tick's chart every tick was taken into account for the calculations.
Thanks
NinjaTrader_Bertrand
09-06-2010, 07:23 AM
Great you got it working - are you talking about backtesting or realtime running with your last question? CalculateOnBarClose is defaulted to 'true' in all historical testing, as the intrabar formation is not know, only the OHLCV values of the series being used.
"CJS"
09-06-2010, 07:30 AM
Thanks for your very quick replies. You help is so helpful.
Is historical testing, but is a 50 ticks bar chart. I thougth the intrabar formation was known in this type of charts.
NinjaTrader_Bertrand
09-06-2010, 07:44 AM
You're welcome, no, those charts are build on a tick interval rather than a time one, however the formation inside those 50 tick bars is still not known and as such the outcome is the same as backtesting time bars: the OnBarUpdate() of your strategy is called on each bar close here.
"CJS"
09-06-2010, 07:53 AM
My last question,
It could be posible to create bar with known intrabar formation with custom coding?.
Is there any axample around?
Thanks
NinjaTrader_Bertrand
09-06-2010, 07:58 AM
You can simulate getting filled intrabar with this sample here - http://www.ninjatrader.com/support/forum/showthread.php?t=6652