![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jun 2010
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
Do you reference a bar more back in your conditions if CalculateOnBarClose is false?
What indicators are you referencing in this strategy?
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jun 2010
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
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.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jun 2010
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
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.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Jun 2010
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
|
My last question,
It could be posible to create bar with known intrabar formation with custom coding?. Is there any axample around? Thanks |
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
You can simulate getting filled intrabar with this sample here - http://www.ninjatrader.com/support/f...ead.php?t=6652
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Strategy.CalculateOnBarClose=true vs. Indicator.CalculateOnBarClose=false | karimatka | Strategy Development | 7 | 05-23-2011 03:39 AM |
| CalculateOnBarClose = false\true | nkonkov | Strategy Development | 3 | 06-17-2010 03:28 AM |
| CalculateOnBarClose = false; | Rhyshaelkan | Indicator Development | 1 | 11-19-2009 03:42 PM |
| what really happens when calculateonbarclose = false | verge | Strategy Development | 9 | 07-28-2008 01:50 AM |
| MACD CalculateOnBarClose=false | mwyatt | Indicator Development | 1 | 01-10-2008 09:31 AM |