---------
if (CrossAbove(SMA(5), SMA(10), 1))
{
if (Position.MarketPosition == MarketPosition.Flat)
EnterLong();
else
ExitShort();
}
if (CrossBelow(SMA(5), SMA(10), 1))
{
if (Position.MarketPosition == MarketPosition.Flat)
EnterShort();
else
ExitLong();
}
---------
This still does not work! When I run the script, even if I have a flat market position, if it crosses, I still get a "Sell Short" order AND a "Sell" order giving me 2 orders and twice the position. (or vice versa if they cross the other way. First it does a "Close Position", then another order to "Sell".
If you look at what "EnterLong" actually means, (StrategyBase.EnterLong) , it means: "Enter a long position via a market order and close any open short positions"
HELP!!!!!!!!!!! All I am trying to do is create a simple strategy that trades on the crossovers and it can't be that hard!!!!!!

Comment