Trailing stop percentuale

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #32193 quote

    Buongiorno
    Se possibile vorrei trasformare questo trailing stop penso creato da Ale e decisamente perfetto in percentuale anziché in punti.  Grazie

    //TRAILING STOP
    TGL =5
    TGS=5
    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
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Trailing stop percentuale


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 1 voice and has 0 replies.

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