drfbParticipant
Average
Buongiorno.
E’ possibile rendere il take profit dinamico? Nel senso che, esiste un comando con il quale, una volta entrati a mercato con qualsiasi tipo di condizione (i parametri sono solo di esempio)
sl= 3
tp= 9
if c1 then
buy 1 contract at market
endif
SET STOP pLOSS sl
SET TARGET pPROFIT tp
si possa spostare sia il tp che lo sl di x pips se il mercato ci è favorevole?
Ho trovato qualche esempio in rete, ma non ho capito molto bene come farlo.
Grazie!!!!
Ciao hai due possibilità:
una in percentuale.
PFL = 1
PFSL = 1
PFS = 1
PSSS = 1
if longonmarket then
set target %profit PFL
endif
if longonmarket then
set Stop %loss PFSL
endif
if shortonmarket then
set target %profit PFS
endif
if shortonmarket then
set stop %loss PSSS
endif
In questo esempio differenziati long/Short
Il secondo modo che si adatta alla volatilità.
ATRL = 15* averagetruerange[5](close)
ATRSL = 4* averagetruerange[3](close)
ATRS = 4* averagetruerange[2](close)
ATRSS = 3* averagetruerange[2](close)
if longonmarket then
set target profit ATRL
endif
if longonmarket then
SET STOP LOSS ATRSL
endif
if shortonmarket then
set target profit ATRS
endif
if shortonmarket then
SET STOP LOSS ATRSS
endif
Se invece vuoi proteggere i profitti devi anche mettere un trailing stop.
drfbParticipant
Average
Intanto grazie del chiarimento. Potresti anche darmi un esempio di trailing stop? Ho visto molti esempi in rete ma ho capito poco il funionafunzio. Grqzie