Hi All,
How would you code your Exit of a long(/short) with the following conditions please?
- Exit (StopLoss) when price hits at DoncianChannelDown(/UP) of the moment of Opening Position (so not trailing)
- Exit (TakeProfit) when price is 1,5 x (PRICE at Opening of Position – DolcianChannelDown(/UP))
Thanks a lot for your wisdom!
There you go:
IF MyLongConditions THEN
BUY 1 Contract AT MArket
SL = (close - DonchianChannelDown[20])
TP = SL * 1.5
SET STOP LOSS SL
SET TARGET PROFIT TP
ENDIF
IF MyShortConditions THEN
SELLSHORT 1 Contract AT MArket
SL = (close - DonchianChannelUp[20])
TP = SL * 1.5
SET STOP LOSS SL
SET TARGET PROFIT TP
ENDIF
grazie mille Roberto!
thank you very much Roberto!
Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums
Thank you 🙂