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 05-10-2012, 09:43 AM   #1
Pcomm69
Member
 
Join Date: Nov 2010
Posts: 62
Thanks: 4
Thanked 2 times in 2 posts
Default CalculateOnBarClose = false;

Hi,

On a Strategy in 220 Tick
When CalculateOnBarClose = true;
if (Open[0] >= Close[0]) ....
run good

but when CalculateOnBarClose = false;
if (Open[0] >= Close[0]) ....
don't run good

my question is in 220 Tick :
with CalculateOnBarClose = false;

how can I obtain the instant value of Open/Close in Tick
and not the Close[0] Value

thanks

Pierre
Pcomm69 is offline  
Reply With Quote
Old 05-10-2012, 09:49 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 977 times in 960 posts
Default

Hi Pierre, I'm sorry but don't follow your inquiry here - what outcome do you expect to seek in COBC = false mode? Is this for backtesting or realtime trading / simulation?

In backtesting COBC would always be 'true' - the strategy has access to the OHLCV info of the series per default only.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 05-10-2012, 09:54 AM   #3
Pcomm69
Member
 
Join Date: Nov 2010
Posts: 62
Thanks: 4
Thanked 2 times in 2 posts
Default

my question is
in Realtime trading
in 220 Tick :
with CalculateOnBarClose = false;

how can I obtain the INSTANT value of Open/Close in Tick
and not the Close[0] Value
Pcomm69 is offline  
Reply With Quote
Old 05-10-2012, 09:55 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 977 times in 960 posts
Default

Pierre, Close[0] in COBC = false is the current last value. The value of the previously closed bar would then Close[1]. Same would apply to the Open.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 05-10-2012, 10:03 AM   #5
Pcomm69
Member
 
Join Date: Nov 2010
Posts: 62
Thanks: 4
Thanked 2 times in 2 posts
Default

OK so my problem is to get the INSTANT PnL

in COBC = false and 220 Tick
how can I get the INSTANT PnL ?
(and not the PnL at the end of 220 Tick)

Thanks
Pcomm69 is offline  
Reply With Quote
Old 05-10-2012, 10:21 AM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 977 times in 960 posts
Default

Have you tried GetProfitLoss() with Close[0] as ref price and running on COBC = false?

http://www.ninjatrader.com/support/h...profitloss.htm
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
CalculateOnBarClose = false question richtobey Automated Trading 1 06-21-2011 01:54 PM
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


All times are GMT -6. The time now is 12:25 PM.