in Search

help with trailing stop

Last post 08-21-2007, 8:14 by wabbit. 2 replies.
Sort Posts: Previous Next
  •  08-05-2007, 9:54 24940

    help with trailing stop

    Dear all,

    I hope somebody can help me out with this challenge.

    When i open a position with a trailing stop, i have to fill in 2 fields in my trade-interface. The distance (difference between stoploss and current price) and the step (the amount the price has to change before the trailing stop is adjusted). I would like to plot the trailingstop, including these 2 variables, on my chart so i can evaluate the settings of these parameters.

    For simplicity sake i use a simple RSI-system to show how far i'm right now.

    LE:=Cross(RSI(14),30);
    LX:=Cross(70,RSI(14));
    Distance:=(ATR(14)*2);
    Step:=Distance/10;
    Target:=(ATR(14)*5);
    Signal:=If(LE=1,1,If(LX=1,-1,0)); {long = 1 and short = -1}

    If(Signal=1,C-distance,If(Signal=-1,C+distance,c))

    I would like to plot a trailing stop below the prices, if the last signal was long. On the other hand a trailing stop above the prices if the last signal was short. In the formula above the trailing stop is only visible on the day of the signal. On the other days the close is shown. The step is not included yet, because i don't know how to do that.

    I hope i explained it clearly and that somebody can help me out.

    Greetings,

    Arne from the Netherlands

     

  •  08-21-2007, 3:01 25079 in reply to 24940

    Re: help with trailing stop

    Hello,

    After testing and surfing on the internet i found the following solution. I don't think it is the most advanced solution, it's quite basic i think, but i will do for me. Please note that it uses the PREV-function, which really slows down the system .

    Period:=10; {look back period to determine volatility}
    Distance:=3; {distance of the stop, normally between 1.5 and 3.0}
    Stoplong:=C*Distance*ATR(Period); {for long positions}
    Stopshort:=C+Distance*ATR(period); {for short positions}
    Bandlong:=If(L<=Prev,stoplong,if(stoplong>prev,stoplong,prev));
    Bandshort:=If(H>=Prev,Stopshort,If(stopshort<prev,stopshort,prev));
    Bandlong;
    Bandshort;

    I mentioned the "step" in my last post, but i don't think it is that important. I use a fixed step of 0.05 right know, and that is also the default.

    Good luck trading.

    Arne

  •  08-21-2007, 8:14 25082 in reply to 25079

    Re: help with trailing stop

    This might be a useful alternative: http://forum.equis.com/forums/thread/20108.aspx


    wabbit Big Smile [:D]


    MS: 6.52 EOD, 7.x EOD, 8.0 PRO, 9.2 PRO w/QC, 10 PRO w/QC & MDK
    For custom MetaStock programming : http://www.wabbit.com.au
    My SkyPE status : wabbit.com.au SkyPE online status
    My SkyPE account : wabbit.com.au

View as RSS news feed in XML