if (CrossAbove(EMA( 5), EMA( 21), 1))
{
EnterLong(Convert.ToInt32(DefaultQuantity), "");
}
if (CrossBelow(EMA( 5), EMA( 21), 1))
{
EnterShort(Convert.ToInt32(DefaultQuantity), "");
}
if (Position.MarketPosition == MarketPosition.Long && Close[0] > (Position.AveragePrice + 40 * TickSize) ) //if more than 200 SL 100
{
ExitLongStopMarket( (Position.AveragePrice + (20 * TickSize)) );
}
else if (Position.MarketPosition == MarketPosition.Short && (Position.AveragePrice - 40 * TickSize )> Close[0])
{
ExitShortStopMarket( (Position.AveragePrice - (20 * TickSize)) );
}
Comment