Trailing stops remaining static when there are multiple positions

Forums ProRealTime English forum ProOrder support Trailing stops remaining static when there are multiple positions

Viewing 15 posts - 1 through 15 (of 48 total)
  • #97896

    Hello folks…… I wonder if you can help me out?

    I noticed yesterday that my trailing stops didn’t move (despite significant market progress in my favour early in the trade), which I assume is because I had two open positions in the same chart. Although the positions were entered by two separate bots (I have one bot for Tuesday AM on the DOW and one bot for Tuesday PM on the DOW), the only thing I can think is that it’s something to do with the cumulative size of my position on that particular chart. I’ve inserted the code for one of the bots below (the other is exactly the same entry rules and code, apart from the hours).

    Am I right that it’s something to do with the multiple positions, or is there another reason?

     

     

     

    #97909

    As I see it … you have no exit conditions so the only exit is via the Trailing Stop or swap over of entry condition?

    You are using CumulateOrders = False and so you will not get multiple positions anyway?

    Attached shows single position only and exits.

    Have I got it wrong what you are saying is your problem?

    #97912

    Although the positions were entered by two separate bots

    Ah I reread slower … I see now you are saying above … so two separate bots are giving you 1 x position on each / multiple positions.

    One bot should not affect the TS on another bot.

     

    #97914

    Thanks for the reply.

    The way it is coded, within one bot there can only ever be one open position but the issue “seems” to be when the afternoon bot opens a position while the morning bot is also still in a position. So even with CumulateOrders = False I do occupy multiple positions on the same chart because they are derived from two separate bots in ProOrder. This could of course be a red herring but it’s the only constant theme I have noticed when my trailing stops have failed to fire in real time. And yes, you are correct that I have no exit rules aside from the trailing stop.

    Hope this helps?

    #97917

    The trailing stop in each strategy should be based on the average price of all open positions of that particular strategy. Having multiple strategies on the same instrument should not change anything as each strategy only looks at its own profit/loss values.

    Maybe a screen shot of the trade/s on a price chart might help us see what is happening?

    #97918

    It would most certainly make sense that one bot wouldn’t conflict with the other, but I thought perhaps because the default Trailing Stop function in ProReal Code relies on the POSITIONSIZE variable in order to calculate (which by my understanding is cumulative), this may be a plausible explanation.

    So putting that hunch aside, why would a Trailing Stop move as it should in most cases, but then become completely static in others?

    #97919

    If you change / add to your code as below and follow the GRAPH values against exits you can see that only way that there is an exit is via the TS??

    I have done this quick without much though so just say if you see it different as I might learn something also!! 🙂

     

     

    #97921

    why would a Trailing Stop move as it should in most cases, but then become completely static in others?

    You sure that when you think the TS is not moving it is that Price did not increase (decrease for shorts) at all after entry and so the TS would not move and would exit the position when position price moves down (moves up for shorts) to reach the TS?

    #97922

    Correction below.

    I think I need to slow down and think!!!?? 🙂

     

    #97924

    Here is a screenshot of one of the offending trades. *Edit* I’ll find a better one and describe it properly. I don’t want to be confusing people. Bear with me…

     

    #97931

    This screenshot explains it better.

    A short trade that entered at 09:52 yesterday. Quite clearly it has performed well in the early bars, and at the time of writing it’s at +259, and yet the stop has never moved from -151 of entry price. I can’t understand why.

    #97939

    The trailing stop in each strategy should be based on the average price of all open positions of that particular strategy. Having multiple strategies on the same instrument should not change anything as each strategy only looks at its own profit/loss values.

    One thing I’d like to add is that both of my “strategies” have exactly the same entry rules. The “multiple strategies” in my example are only separated by entry time and stop size. I’ve read what has already been said about how one strategy shouldn’t conflict with another, but I thought it might be worth adding just how similar the two strategies are just in case this might be an obscure bug or something. Having seen the screenshot where there is a trade that is clearly performing well but the stop doesn’t change, can you think of a better explanation?

    If you change / add to your code as below and follow the GRAPH values against exits you can see that only way that there is an exit is via the TS??

    Yes, that is my strategy. Exit of each trade is the trailing stop.

     

    #97942

    Exit of each trade is the stop.

    Because you use CumulateOrders = False and you do not use If Notonmarket (on your entries) then when you are Long and price meets short entry conditions then there will be a swap of trading direction (Long to Short) so there will exits by other than the TS.

    What I should have said (in my post above) in bold below

    If you change / add to your code as below and follow the GRAPH values against exits you can see that only way that there is an exit on some / most is via the TS??

    #97943

    and you do not use If Notonmarket (on your entries)

    Yes he does! Check the code in the first post – it is the last condition in lines 31 and 45. More coffee for you I think!

    #97944

    But I do use “notonmarket”. It’s in the code. This isn’t about trades flipping midway through because of another entry signal, this is about trades being allowed to run on to the original stop point, which they shouldn’t do if their average performance has been favourable at any point in the trade. When trade position improves by X, so too should trailing stop position. And I’ve seen the trailing stop function do this perfectly well on other occasions (including some singular trades today), but in my example the stop didn’t ‘trail’ at all.

Viewing 15 posts - 1 through 15 (of 48 total)

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