Dynamic trailing stops

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #38220 quote
    Francesco78
    Participant
    Master

    Hello, I was wondering if for you it makes sense to test a strategy with “dynamic trailing stops”

    With this I mean the following (Credit to ALE for the coding of the trailing stops) . Does it make sense? PRT is handling it?

    //TRAILING STOP
    
    TGL =a*ATR //DYNAMIC TRAILING
    TGS=b*ATR //DYNAMIC TRAILING
    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
    
    set target pprofit PF
    endif
    #38221 quote
    dreif123
    Participant
    Average

    hi,
    I guess only in backtesting its working …but not on live trading

    Francesco78 thanked this post
    #38249 quote
    Nicolas
    Keymaster
    Master

    You guess wrong 🙂 It should also work perfectly in live trading, this trailing stop code use pending STOP orders which are put at price levels calculated each bar. Of course, like any other ProOrder program it is only read once per bar.

    Spread and order distance from current price should also be considered when using this code.

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

Dynamic trailing stops


ProScreener: Market Scanners & Detection

New Reply
Author
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by Nicolas
8 years, 8 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 06/13/2017
Status: Active
Attachments: No files
Logo Logo
Loading...