ciao a tutti,volevo fare un backtest pero non so come dire al programma,che una volta che l operazione è in profitto del 20% rispetto al TAKE PROFIT E in automatico venda metà posizione e metta lo stop a 0. GRAZIE
Eccolo:
ONCE SL = 100
ONCE TP = SL * 2
ONCE Pc = TP * 0.20 //20%
ONCE Flag = 0
IF OnMarket AND Flag = 0 THEN
IF ((close - TradePrice) * PipSize) THEN
SELL 1 CONTRACT AT MARKET
Flag = 1
ENDIF
ENDIF
Sma20 = average[20,0](close)
IF Not OnMarket AND close CROSSES OVER Sma20 THEN
BUY 2 Contract at Market
Flag = 0
ENDIF
SET STOP pLOSS SL
SET TARGET pPROFIT TP