Trailing Stop with Supertrend

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #98716 quote
    Pere
    Participant
    Veteran

    I’m a fan of Supertrend, which I find very useful to do a kind of trailing stop, and I use it most of the cases manually, because if I use it on an automated ProOrder, the order stops always on the next candle where close crosses over or under the value of Supertrend.

    But sometimes, in case of high volatility, the difference between close and Supertrend value is very big and losses are too high.

    How can I program a trailing stop with the Supertrend values where the trade stops immediately if it touches Supertrend (like a normal trailing stop), not on the end of the bar when it closes?

    #98717 quote
    robertogozzi
    Moderator
    Master

    You need to use MTF to check ST on a lower TF!

    #98719 quote
    Pere
    Participant
    Veteran

    I’m using IG + PRT version 10.3 and don’t have MTF.

    However, I don’t think that this could be a solution, because in a lower TF there is more volatility.

    #98722 quote
    robertogozzi
    Moderator
    Master

    You can use pending orders:

    MyST = SuperTrend[3,45]
    .
    .
    IF LongOnMarket THEN
       SELL AT MyST STOP
    ENDIF
    Pere and Rob Surf thanked this post
    #98757 quote
    Pere
    Participant
    Veteran

    This is a good idea, @robertogozzi. I Will test it.

    Thank you!

    #133446 quote
    Rob Surf
    Participant
    New

    You can use pending orders:

    This is exactly what I was looking for!! Thanks soo much!

    Is there anyway to apply this to buying so that it doesn’t wait until the end of the bar? My code opens a position with a new high, but waits until the end of the bar. please see below.

    IF Condtion1 THEN
    BUY  1 lot AT MARKET
    ENDIF
    #133447 quote
    Vonasi
    Moderator
    Master

    Pending orders have to be placed on every bar so just place one at the same time as you place your buy order.

    MyST = SuperTrend[3,45]
    
    if condition1 then
    buy 1 lot at market
    sell at Myst stop
    endif
    
    IF LongOnMarket THEN
       SELL AT MyST STOP
    ENDIF

    Note: Please always use the Insert PRT Code’ button when putting code in your posts – even if it is only a few lines of code. I have edited your post.

    #133485 quote
    nonetheless
    Participant
    Master

    Hi @Pere, I also use Supertrend a lot but I usually use an ATR trail. As Supertrend is based on ATR + multiplier, the trailing stop tends to be very close to the Supertrend level – depending on the settings for both of course. Could be an option.

    #133520 quote
    Rob Surf
    Participant
    New

    The problem with using a trailing stop through ig markets when cumulateorders=true is that it calculates on the average entry price, something IG markets doesn’t allow. Using a pending order applies to the individual positions but still stops them all at the same level and importantly mid way through the price bar and not calculated after the candle is formed, hence managing the risk much better as positions often get stopped out during volatility.

    This is from IG markets

    “After discussions with ProRealTime it has been decided that ProOrder for IG will not calculate on average entry prices but be based on the individual positions entry price. This has been decided to avoid frequent updates to stops and to avoid stops being rejected at less protective levels than before because of the minimum distance being taken into account at the time of update. “

    GraHal thanked this post
    #133573 quote
    GraHal
    Participant
    Master

    will not calculate on average entry prices but be based on the individual positions entry price.

    Anybody … is above a recent change or has it been that way for > 1 year??

    #133794 quote
    Rob Surf
    Participant
    New

    I received this correspondence in 2014. It’s still the case today. At least it shows up on the back testing now. I found out the hard way back in 2014.

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

Trailing Stop with Supertrend


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Pere @petrus Participant
Summary

This topic contains 10 replies,
has 6 voices, and was last updated by Rob Surf
5 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/17/2019
Status: Active
Attachments: No files
Logo Logo
Loading...