trailing stop with cumulative orders

Forums ProRealTime English forum ProOrder support trailing stop with cumulative orders

Viewing 15 posts - 1 through 15 (of 17 total)
  • #146926

    I tested a new system today in 2 versions with cumulative orders true and false. The latter opened one position which closed in profit as the price retraced to the trailing stop.

    The one with cumulative orders opened multiple positions, but none of them closed out as the price fell — ie the trailing stop had no effect at all.

    Is there any way to make a trailing stop work with cumulative orders?

    #146932

    I guess the last trade to open did not achieve the starting level of the trailing start and so therefore this non-started trailing stop was applied (i.e. not applied) to all cumulated trades?

    #146945

    If you are using a code snippet as a trailing stop, replace TRADEPRICE with POSITIONPRICE, which is the average price used by ProOrder with multiple cumulated positions.

    This should make things better, but previously saved profits would require to be updated after accumulating positions, to fully make it work as expected.

     

    #146947

    Thanks Roberto, that seems to have made a big difference. What do you mean though when you say, previously saved profits would require to be updated after accumulating positions ?

    #146950

    I mean that if you buy (say 1 lot) at 1000 with a trailing start at 20 and a trailing step of 10, after +32 points you’ll have:

    Current Price                                       1032              PositionPrice (former TradePrice) is 1000

    Profits locked in                                      10              (you will exit at 1010 in case price retraces)

    after cumulating 1 more lot at, say 1034,  PositionPrice  is 1017    ((1000 + 1034) / 2):

    Profits previously locked in                  10              (you will still exit at 1010 in case price retraces, but you will lose because PositionPrice is now 1017)

    update profits to be locked in          1027             1017 (current PositionPrice) + 10 pips (first step), so you will be able to exit profitaby at 1027.

    It’s not that straightforward and needs some extra coding, but it’s worth doing it.

     

     

     

    #146951

    This is Nicolas’code updated to accomodate for cumulative positions (the attached pics highlights changes, apart from PositionPrice):

     

    2 users thanked author for this post.
    #146956

    that’s great – thanks Roberto

    #147037

    Link to Nicolas Code above for Cum TS added as Log 253 here …

    Snippet Link Library

    3 users thanked author for this post.
    #213589

    Is it better to replace lines 50 and 51 with the new Set Stop Price X function ?

    #213611

    Yes, it’s a code snippet written years before those new instructions were added.

    It’s easy to replace them, just replace both of those lines with this one:

     

    1 user thanked author for this post.
    #213850

    Yes, it’s a code snippet written years before those new instructions were added.

    It’s easy to replace them, just replace both of those lines with this one:

    Is it possible to use set stop price for exit from a position but with 2 different level and of course different qantity ?

     

    #213852

    You could set up a Test Algo on your Demo Account …

     

    #213853

    It works, but doesn’t drop to 0 positions … thats for you to figure out! 😉

     

    1 user thanked author for this post.
    #213855

    Sorted!

    It’s more fun trying and just doing it?

     

    1 user thanked author for this post.
    #213859

    It’s more fun trying and just doing it?

    I was only jesting! 🙂

    Coding Algos can be frustrating and very time consuming. We should all try to help each other more, even though at times it feels like the blind leading the blind! 😉

     

    1 user thanked author for this post.
Viewing 15 posts - 1 through 15 (of 17 total)

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