Trailing Stop in percentuale

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #39416 quote

    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
    #39425 quote
    Nicolas
    Keymaster
    Master

    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
    #39434 quote

    Grazie

    ora provo se funziona

    #42808 quote

    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

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Trailing Stop in percentuale


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Mauro T. “Algorithm System”
8 years, 6 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 06/29/2017
Status: Active
Attachments: No files
Logo Logo
Loading...