Breakeven- en trailingstop on different securities & indexes & forex

Forums ProRealTime English forum ProOrder support Breakeven- en trailingstop on different securities & indexes & forex

  • This topic has 79 replies, 15 voices, and was last updated 3 years ago by avatarPaul.
Viewing 15 posts - 1 through 15 (of 80 total)
  • #90468

    Use breakeven- en trailingstop on different securities & indexes & forex

    I want it to work well in every scenario, regardless of forex, shares etc.

    So i’am testing one variable extra and called it underlaying.

    It seems I got it to work for SL & PT & BE.

    Underlaying1 is not meant to optimize. It’s either 0.01 0.1 1 10 100 depending on forex, index etc.

    With the right value the lines match the SL and PT. If that’s correct the BE value is correct too.

    i.e. use for gdpusd underlaying1=0.01 but for the dax underlaying1=100 and for shares 1.

    And so far no need to touch underlaying2

    I’am open for suggestions, for a cleaner code and a solution for the TS.

     

    1 user thanked author for this post.
    #90511

    Finished code! Case closed

     

     

    #93987

    Just an addition.

     

     

     

    1 user thanked author for this post.
    #94016

    great thx!

    1 user thanked author for this post.
    #95139

    Too much work went into this so better store it here.

    3 Level trailing stop and manage 2 positions in the same direction.

     

     

     

     

    1 user thanked author for this post.
    #95140

    Just a bit more info on the above code;

    If the first position (long i.e.) goes down and a second position is added, it has the same exit trailing stop strategy as the first trade.

    Resulting in a smaller loss when hitting stoploss (not included here)  and a greater result when the 1st position reaches the trailing stop criteria.

     

    1st leg 0.35% gain to 0.45% and trailing-stop 0.35% is activated and uses default close

    2nd leg 0.45% gain to 0.60% and trailing-stop 0.25% is activated and uses high/low instead of close for better results

    3rd leg 0.60% gain or higher and trailing-stop 0.20% is activated and uses high/low instead of close for better results

     

    the switch levels are calculated from the trailing-stop values to reduce parameters.

     

    1 user thanked author for this post.
    #97312

    update trailing-stop for 2 positions

    update stoploss for 2 positions

     

     

    #97313

    1st

    2nd

    3rd

    1 user thanked author for this post.
    #97630

    just some comparison test

    1% stoploss, trailing stop and no profit target

     

    running 2 positions everything the same

    VS

    1 position and adding another one only when 1st reached -.20% loss; stoploss both positions based on first position and trailing stop based on second position

     

    Bit less profit, but less drawdown, better gain/loss ratio and balanced average gain of winning and losing trades.

    2 users thanked author for this post.
    #97640

    Sounds great Paul, thank you for your time and skills and for sharing!

    Please forgive the daft question, but what is the 1st, 2nd and 3rd … anybody?

    1 user thanked author for this post.
    #97680

    there’s nothing to it. Some things on top, below and on the bottom in the strategy.

     

    With a trailing stop and stoploss working nicely, the only thing left is a good entry 🙂

    #97729

    Function ghaph

    Hello, sorry for the ignorance on the subject, but I can’t understand what to remove in the ghaph function to make the strategy work automatically. I did tests but without success. Thanks for your help.

    1 user thanked author for this post.
    #98006

    Hi Fabiano

    You disabled too much.

    for real trading use this;

    same for the profittarget

    add  // before graphonprice for trailingstop and breakeven

    add // before graph

     

    Now for backtesting you wan to see the lines, so

    same for the profittarget.

    remove // before graphonprice for trailingstop and breakeven

    remove // before graph

    I attached 2 codes as example for real and the backtest to see the differences.

    1 user thanked author for this post.
    #98009

    just what I’am using now.

    Ditched the Breakeven strategy and use a 3 level trailing stop.

    same code, one for backtest and to see the difference one for real.

    1 user thanked author for this post.
    #126139

    atr trailing stop & atr breakeven stop. Both can be used.

     

     

     

     

    3 users thanked author for this post.
Viewing 15 posts - 1 through 15 (of 80 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login