NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM 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 06-04-2011, 11:40 PM   #1
kaywai
Senior Member
 
Join Date: Sep 2009
Posts: 562
Thanks: 40
Thanked 4 times in 4 posts
Default if my indicator is set to CalculateOnBarClose = true

can my strategy be on a CalculateOnBarClose = false?

Happy to keep the indicator running at CalculateOnBarClose though...but would like my entry and money management to run "live".
kaywai is offline  
Reply With Quote
Old 06-05-2011, 09:08 PM   #2
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Thanks for the note.

You can however you want to code this into your strategy to reference it as COBC = false (You want all COBC to match or you will run into issues). Then only access the indicator balue on if (FirstTickOfBar) and store the value of the indicator you need for access on all other ticks so it is the same until the next bar close and use that in your COBC=false strategy.

Let me know if I can be of further assistance.
NinjaTrader_Brett is offline  
Reply With Quote
Old 06-12-2011, 01:01 AM   #3
kaywai
Senior Member
 
Join Date: Sep 2009
Posts: 562
Thanks: 40
Thanked 4 times in 4 posts
Default

Hi Brett,

Can FirstTickOfBar be used in hourly or minute bars?

Alternatively, if COBC = true, when will Open[0] be calculated? At the start or the end of the current bar?

Regards

Kay Wai
kaywai is offline  
Reply With Quote
Old 06-12-2011, 06:55 PM   #4
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

Kay Wai, FirstTickOfbar can be used in hourly/minute charts, but I believe you need to do so with COBC = false.

If COBC = true, Open[0] will be calculated (revealed by the next OnBarUpdate()) at the close of the bar.
NinjaTrader_Austin is offline  
Reply With Quote
Old 06-12-2011, 09:00 PM   #5
kaywai
Senior Member
 
Join Date: Sep 2009
Posts: 562
Thanks: 40
Thanked 4 times in 4 posts
Default

thanks austin
kaywai 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
when is OnBarUpdate() called when the "CalculateOnBarClose" property is set to true? clearpicks General Programming 1 12-12-2010 10:15 AM
CalculateOnBarClose = true; gunsnmoney Strategy Development 1 03-05-2010 03:47 AM
CalculateOnBarClose = true; but its not? ohowie General Programming 5 02-07-2008 09:49 PM
Indicator line goes to zero when CalculateOnBarClose set to True ThePatientOne Indicator Development 1 08-30-2007 11:42 AM


All times are GMT -6. The time now is 05:15 PM.