Trouble with trailing stop loss

Forums ProRealTime English forum ProOrder support Trouble with trailing stop loss

  • This topic has 9 replies, 5 voices, and was last updated 5 years ago by avatarLeo.
Viewing 10 posts - 1 through 10 (of 10 total)
  • #69799

    Hi all,

    This is my first post and my first foray into the world of prorealtime so forgive me if this is a simple fix!

    I’ve set up an auto trading system and want a trailing stop loss of 12 points on each order that is executed however it doesn’t seem to be working correctly. Each trade that has been activated so far (on the prorealtime demo platform via IG) has either gone straight down and hit the 12 point stop (as expected) or gone up, in one instance over 30 points, and then stopped out where it entered, finishing with a loss of 2 points (the spread). I can’t for the life of me work out why it isn’t working. My understanding is that if it went up 30 points then with a 12 point trailing stop, I should guarantee a profit of 18 points.

    Anyway, here’s the code. Any help will be much appreciated.

     

    #69802

    Hi John

    What Timeframe are you using?

    Is the 30 point gain at the end of the bar as the code is read and executed only at the end of each bar?

    I will run your code now and let you know if have any further thoughts.

    Cheers
    GraHal

    #69803

    Hi GraHal, thanks for the response.

    I’m using a 1 hour time frame on Wallstreet. I had trades open today between 1700 – 1900 on the hour, all closing for a 2 point loss despite all rising by over 12 points. I think the longest time a trade was open was approx. 15 mins so still within that hour bar.

    Cheers,

    John

    #69804

    You used MACD in your code, have you seen the Thread below

    https://www.prorealcode.com/topic/prt-macd-corrupted/

     

    #69805

    My brain needs rest but I think the main issue is that TS of 12 does not give the market enough room to retrace? Everybody is so twitchy now that a 12 point rise is followed by a retrace and so taking out your stop.

    I got attached with below on the DAX 30 min TF with a spread of 2.

     

    #69811

    do you need “p”?

    https://www.prorealcode.com/documentation/trailing/

    i dont use these trailing stops because some issues in the past but maybe they have fixed them now?

     

     

    #69812

    all closing for a 2 point loss despite all rising by over 12 points.

    Pick one of the trades and follow it through on a tick by tick chart.

    You will surely see price – after rising by 12+ points  and so causing your TS = 12 to rise to near your TradePrice – price must then be retracing to near your TradePrice and hence taking you out as price hits your TS?

    If price rises by 24+ points then the TS moves up twice (but would still be 12 points behind price) and then price retraces and take you out (on the TS) for a 12 point gain?

    Let us know if above is what you see on a tick chart of the trade?

    Anyway @stonecoldjohn the sun is shining today in the UK (what part of UK are you?) so you should warm up this bank holiday weekend! 🙂

    #69907

    I might be wrong but instead of listing up every candle 20 candles back, cant u just use the following?

     

    #69912

    @jebus89 I figured he must be looking for a long slow steady trend with no significant retrace within the last 20 hours (as on 1 H TF)??

    But that may be why his stops get taken out very early on in trades because after a such a long slow steady trend over 20 hours then a retrace is very likely??

    Anywhere where is  stonecoldjohn … he can’t be frozen solid after this lovely warm weekend!! Maybe he’s just frozen out of his trades!! 🙂 🙂

    #69955
    Leo

    I might be wrong but instead of listing up every candle 20 candles back, cant u just use the following?

    Buysignal = close > highest[20](high[1])
    shortsignal = Close < lowest[20](low[1])

Viewing 10 posts - 1 through 10 (of 10 total)

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