Chiedo gentilmente se con ProOrder, avendo inserito sia lo stop che il target sia possibile inserire anche un trailing stop in percentuale.
Per ora uso questo ma purtroppo è in punti che va bene per le valute ma con il Dax sorge il problema della differenza che si ha nel tempo .
Nella statistica il valore dell’ indice nel 2010 è esattamente la metà che abbiamo oggi .
Vi ringrazio in anticipo .
TGL = 48.5
TGS = 22
if not onmarket then
MAXPRICE = 0
MINPRICE = close
PREZZOUSCITA = 0
ENDIF
if longonmarket then
MAXPRICE = MAX(MAXPRICE,close)
if MAXPRICE-tradeprice(1)>=TGL*pointsize then
PREZZOUSCITA = MAXPRICE-TGL*pointsize
ENDIF
ENDIF
if shortonmarket then
MINPRICE = MIN(MINPRICE,close)
if tradeprice(1)-MINPRICE>=TGS*pointsize then
PREZZOUSCITA = MINPRICE+TGS*pointsize
ENDIF
ENDIF
if onmarket and PREZZOUSCITA>0 then
EXITSHORT AT PREZZOUSCITA STOP
SELL AT PREZZOUSCITA STOP
ENDIF
Se si desidera modificare dinamicamente le impostazioni di stop trailing al prezzo corrente, è possibile modificarli come questo:
percentageLong = 0.1 //0.1%
percentageShort = 0.2 //0.2%
TGL = (close/100)*percentageLong
TGS = (close/100)*percentageShort
Ho provato Il trailing stop al prezzo corrente ma purtroppo prende la percentuale che vuole.
entrato oggi short alle 9 sul 4 ore indice Francese a 5182.8 alle ore 13 il trailing doveva impostarsi a 5157 invece si è messo a 5146.1 .
in pratica fa la percentuale che vuole .
Non capisco dove è l’ errore.
Ti Ringrazio anticipatamente
Mauro
percentagelong = TGL
percentageshort = TGS
TGL =0.97
TGS= 0.31
if not onmarket then
MAXPRICE = 0
MINPRICE = close
PREZZOUSCITA = 0
ENDIF
if longonmarket then
MAXPRICE = MAX(MAXPRICE,close)
if MAXPRICE-tradeprice(1)>=TGL*(close/100)*percentagelong then
PREZZOUSCITA = MAXPRICE-TGL*(close/100)*percentageshort
ENDIF
ENDIF
if shortonmarket then
MINPRICE = MIN(MINPRICE,close)
if tradeprice(1)-MINPRICE>=TGS*(close/100)*percentagelong then
PREZZOUSCITA = MINPRICE+TGS*(close/100)*percentageshort
ENDIF
ENDIF
if onmarket and PREZZOUSCITA>0 then
EXITSHORT AT PREZZOUSCITA STOP
SELL AT PREZZOUSCITA STOP
ENDIF