View Full Version : FIRST TICK after strategy starts
junkone
09-14-2010, 01:48 PM
how do i detect the first tick after the strategy starts?
NinjaTrader_RyanM
09-14-2010, 02:10 PM
Hello Junkone,
This is for a NinjaScript strategy.
You can check if the bar processing is not historical.
if (!Historical)
That will return true for the first (and all subsequent) bars after the strategy starts. You could use a bool flag to only check once.
junkone
10-11-2010, 12:53 PM
i found this method.
protected override void OnStartUp()
{
}
what is the difference between this and that.
NinjaTrader_RyanM
10-11-2010, 01:36 PM
OnStartup() (http://www.ninjatrader.com/support/helpGuides/nt7/onstartup.htm) is called only once immediately prior to the start of your script, but after the Initialize() (http://www.ninjatrader.com/support/helpGuides/nt7/initialize.htm) method.
OnStartup is called before OnBarUpdate(), so does not relate to bar processing or identifying any bar properties.