PDA

View Full Version : Next bar and Real time


Agamenon
11-19-2007, 01:55 PM
Hi again! I´m working in do things in next bar with:
CalculateOnBarClose = false;

What kind of counter I can use for get a event in this bar and wait to next bar to execute? Example: I get indicator signal, but i want EnterLong o Short to entry in next bar o next open bar. What can I do? :confused:

NinjaTrader_Ray
11-19-2007, 02:58 PM
How about using an internal bool variable that you set to true when the condition is true, then on the first tick of the next bar check if the condition is true, submit order, set variable to false.

Agamenon
11-19-2007, 03:30 PM
perfect, no problem with boolean code, but, How can I know what it is the first following bar or when appear the next bar?

NinjaTrader_Ray
11-19-2007, 03:36 PM
See FirstTickOfBar (http://www.ninjatrader-support.com/HelpGuideV6/FirstTickOfBar.html)property.

Keep in mind, running with CalculateOnBarClose == false has no impact in a backtest, its *always* internally running on the close of a bar.

Agamenon
11-19-2007, 06:16 PM
Excelent! this is that I was looking for! Thx!:)