protected override void OnBarUpdate()
{
var sma1 = SMA(10);
var sma2 = SMA(20);
/* Enter a long position if 10 SMA crosses above 20 SMA within the last bar */
if (CrossAbove(sma1, sma2, 1)) {
/* Debug messages, to NinjaTrader output window */
var msg = string.Format("Entering Long. SMA1 = {0}, SMA2 = {1}", sma1[0], sma2[0] );
Print(msg);
EnterLong();
}
}
And here's what I see under "Orders($)" in the Strategy Analyzer screen:
There seems to be a mismatch; the Output screen shows that EnterLong() was called 5 times, yet under "Orders($)" it shows that there were only 2 Buy Market orders. Shouldn't there be 5 Buy Market orders as well? Could you explain on this?
Greatly appreciate your help on this, and sorry if this is a newbie question.

Comment