//Allow only entries if no current position open
if (Position.MarketPosition == MarketPosition.Flat)
and
//Allow only entries if no current position open
if (Position.MarketPosition == MarketPosition.Short)
Anybody have an idea why???
{
// Condition set 1
if (CrossBelow(EMA(5), EMA(50), 1))
{
//Allow only entries if no current position open
if (Position.MarketPosition == MarketPosition.Flat)
{
EnterShort(DefaultQuantity, "Sell Short on 5 cross 50");
}
}
// Condition set 2
if (CrossBelow(EMA(30), EMA(5), 1))
{
//Allow only entries if no current position open
if (Position.MarketPosition == MarketPosition.Short)
{
ExitShort("", "Exit Short on 30 cross 5");
}
}
}
I am trying to make sure that only one order gets filled. By the way, the entire strategy compiles with no problems????
Thanks!

Comment