Este es el código para tener el SL inicial por debajo del SMA50, que permanece fijo:
|
Sma50 = average[50,0](close) MyLongConditions = close CROSSES OVER average[10,0](close) IF MyLongConditions AND Not OnMarket THEN BUY 1 Contract at Market Sl = close - Sma50 Tp = Sl * 2 SET TARGET PROFIT Tp SET STOP LOSS Sl ENDIF |
Este es el código para tener el SL inicial un 1% por debajo del SMA50, que permanece fijo:
|
Sma50 = average[50,0](close) MyLongConditions = close CROSSES OVER average[10,0](close) IF MyLongConditions AND Not OnMarket THEN BUY 1 Contract at Market Sl = close - (Sma50 * 0.99) Tp = Sl * 2 SET TARGET PROFIT Tp SET STOP LOSS Sl ENDIF |
Este es el código para tener el SL inicial un 1% por debajo del SMA50, que se actualiza siguiendo el promedio:
|
Sma50 = average[50,0](close) IF LongOnMarket THEN Sl = TradePrice - (Sma50 * 0.99) SET STOP LOSS Sl ENDIF MyLongConditions = close CROSSES OVER average[10,0](close) IF MyLongConditions AND Not OnMarket THEN BUY 1 Contract at Market Sl = close - (Sma50 * 0.99) Tp = Sl * 2 SET TARGET PROFIT Tp SET STOP LOSS Sl ENDIF |