NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 09-06-2010, 07:03 AM   #1
"CJS"
Senior Member
 
Join Date: Jun 2010
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
Default Do not work if CalculateOnBarClose = false;

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.
"CJS" is offline  
Reply With Quote
Old 09-06-2010, 07:10 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Do you reference a bar more back in your conditions if CalculateOnBarClose is false?

What indicators are you referencing in this strategy?
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 09-06-2010, 07:15 AM   #3
"CJS"
Senior Member
 
Join Date: Jun 2010
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
Default

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
"CJS" is offline  
Reply With Quote
Old 09-06-2010, 07:23 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

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.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 09-06-2010, 07:30 AM   #5
"CJS"
Senior Member
 
Join Date: Jun 2010
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
Default

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.
"CJS" is offline  
Reply With Quote
Old 09-06-2010, 07:44 AM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

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.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 09-06-2010, 07:53 AM   #7
"CJS"
Senior Member
 
Join Date: Jun 2010
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
Default

My last question,

It could be posible to create bar with known intrabar formation with custom coding?.

Is there any axample around?

Thanks
"CJS" is offline  
Reply With Quote
Old 09-06-2010, 07:58 AM   #8
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

You can simulate getting filled intrabar with this sample here - http://www.ninjatrader.com/support/f...ead.php?t=6652
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -6. The time now is 10:58 PM.