Eccolo (ho commentato il riferimento al TIMEFRAME in modo da usarlo in qualunque TF):
|
DEFPARAM CumulateOrders = false //Timeframe(Weekly) ONCE Periodi = 10 DonchianSUP = highest[Periodi](high[1]) //DonchianINF= lowest[Periodi](low[1]) c1 = close Crosses Over DonchianSUP c2 = momentum[50](close) > 12 IF c1 AND c2 AND Not OnMarket THEN TP = close * 0.20 //20% take profit SL = close * 0.15 //15% stoop loss BUY 1 Contract AT Market SET TARGET PROFIT TP SET STOP LOSS SL ENDIF |