AVERAGE TRUE RANGE TRAIL STOP ON Tradestation?

Discussion in 'Trading Software' started by Vienna, Mar 2, 2003.

  1. Vienna

    Vienna

    I use standalone Tradestation.

    I would like to set a trail stop let's say 3x ATR for my positions. Anybody knows how to do this? Do I need to buy an add-on from somebody?

    Thanks!
     
  2. Doesn't TS6 have an ATR based trailing stop code as part of the canned programs? I think it might have a minimum range that the security needs to travel before the stop kicks in, but you can probably adjust or eliminate this.
     
  3. Vienna

    Vienna

    Thanks. Tradestation 2000i, version 5.0 it seems. What I try to have is a line on my screen (like a MA) which shows the ATR based stop. Have seen it in publications etc., but have no idea how to get it. It's not one of the canned Tradestation indicators...
     
  4. This is a copy of the canned TS6 long exit trailing stop. Hopefully it'll get you started:


    {
    LX trailing stop based on ATR, activates immediately after entry; profit floor not
    required because stop starts out loose; entry-bar protection included.

    NOTE: This is not a strict trailing stop because the stop can actually loosen
    sometimes instead of always tightening. To convert to a strict trailing stop, ATRVal
    should be fixed at the entry-bar for each position.
    }

    inputs: ATRLength( 10 ), NumATRs( 3 ) ;
    variables: ATRVal( 0 ), MP( 0 ), PosHigh( 0 ) ;

    ATRVal = AvgTrueRange( ATRLength ) * NumATRs ;
    MP = MarketPosition ;

    if MP = 1 then
    begin
    if MP[1] <> 1 or High > PosHigh then
    PosHigh = High ;
    Sell ( "AtrLX" ) next bar at PosHigh - ATRVal stop ;
    end
    else
    Sell ( "AtrLX-eb" ) next bar at High - ATRVal stop ;


    { ** Copyright (c) 1991-2002 TradeStation Technologies, Inc. All rights reserved. ** }

    Enjoy
     
  5. Vienna

    Vienna

    Thanks so much for your time!