Then at a point (when the EMA's cross again) it should sell the 100 shares and short 100 shares.
That's where I get the error. It will close the first position and not open
the new one. See below code. Is this not correct? It works great in
back test mode, but for some reason I get errors when it is live and
the strategy stops.
// Condition set 1
if (CrossAbove(EMA(Fast), EMA(Slow), 1))
{
EnterLong(Shares, "EMA System Long");
PlaySound(@"C:\Program Files\NinjaTrader 6.5\sounds\Alert4.wav");
}
else if (CrossBelow(EMA(Fast), EMA(Slow), 1))
{
EnterShort(Shares, "EMA System Short");
PlaySound(@"C:\Program Files\NinjaTrader
6.5\sounds\Alert4.wav");
}

Comment