PDA

View Full Version : CalculateOnBarClose=true vs False. Please clarify.


sudharsanv
02-10-2010, 11:12 AM
Hello,
I am new to NinjaScript and am trying to develop a Custom Strategy.
I am confused on "calculateOnBarClose" value for "BackTesting" vs "Live Strategy".

Question 1:
********
When I am executing a Live Strategy, and if "executeOnBarClose=True", will NinjaTrader fire the entry order on the Open of Next bar after the bar on which my signal is triggered??

Question 2:
**********
When I am executing a Live Strategy, and if "executeOnBarClose=True", will NinjaTrader fill me if my exit target is reached, even before the close of a bar or it strictly evaluates my target ONLY on the close of each bar?

Thanks in Advance,
Sudharsanv.

NinjaTrader_RyanM
02-10-2010, 11:30 AM
Hello Sudharsanv,

Thank you for your post.

1) Yes. The bar isn't complete until the opening of the next bar. This is when your order will be placed.

2) It only evalutes on the close. If the condition is true on the close then it will submit. If your condition is true while the bar is forming and then is false when the bar closes, then an order will not be submitted.

sudharsanv
02-10-2010, 11:39 AM
Hello Ryan,
Then, I have quite a dilemna. Please see my Issue.
1.) I do not want my Signal to be triggered intra-bar, before the bar closes. In other words, I always want my entry signal to be evaluated ON BAR CLOSE.
2.) However, after I am filled on entry, I do not want to wait till the next bar close, to evaluate Exit condition. Is there any way, ONLY FOR EXIT, that an intra-bar evaluation can be done?
Thanks,
Sudharsanv

NinjaTrader_RyanM
02-10-2010, 11:44 AM
Hi Sudharsanv,

Take a look at this reference sample at the link below:
http://www.ninjatrader-support2.com/vb/showthread.php?t=19387

This reference sample demonstrates running some logic once per bar and running other logic on every single tick.