ADVANCED TRAILING STOP
Why have I developed this?
The Advanced Trailing Stop, based on the Chandelier
Exit developed by Chuck
Le Beau, is volatility-based. Dr. Van K. Tharp in his book Trade
your way to Financial Freedom says "volatility stops are
among the best stops you could select". I've been using the volatility
stop technique for a few years now.
Using the Metastock Developer's
Kit, I developed a I developed a Metastock
Formula Language lacked a simple way of referencing prices
from the entry day of the trade. If you just want to download
DLL, scroll to the bottom of this page.
traders set stops according to a fixed % movement. However,
the % method needs to be adjusted according to the volatility
the security being traded.
Using a volatility based stop means that your stop automatically takes account
the security's volatility.
For example, if the security has a high volatility,
your stops will be a reasonable distance away from the price
action (to give the security room to move in its normal intraday
movements). If a security has a low volatility then the stop
will be relatively closer to the price action. If the security's
volatility changes whilst a trade is underway, the stops will
adjust according to this volatility. The advantage to this type
of stop is that it can be used in any market (blue chip stocks, speculative
stocks, futures, index trading, mutual funds etc.)
The Advanced Trailing Stop has the following
- Initial Stop, expressed in terms to the entry day
(eg. Closing price less 2 ATRs)
- Trailing Profit stop, calculated on each bar of the day after
entry (eg. High less 3.5 ATRs)
Optionally, you can also incorporate the following types of
- Breakeven stop - this is calculated on the entry day and is
implemented when the stock passes a "transition point".
(eg. Move my initial stop to a breakeven stop when the price
2 ATRs above my entry price). I believe this transition/breakeven
stop was part of the original Turtles trading technique.
- Pyramid Points/Tightening Stops - the Trailing Profit Stop
can be recalculated when the stock passes further transition
points. I have defined two such points. (eg. When the stock moves
more than 4 ATRs above my entry price, change to a trailing profit
stop that is the High less 3 ATRs. If it reaches 6 ATRs above
my entry price, change to a trailing profit stop that is the
high less 2.5 ATRs). Chuck Le Beau talks about this tightening
of the stops in his original newsletter.
If any of your stops are hit, the Stop Loss line will continue
to be drawn across the screen. This is good for your psychologically if
you can't get out of a trade. It'll keep telling you to get out! The line
will not trail the price any further (it will be flat) just to re-emphasise
that you should be out of the trade.
WHY HAVE I DEVELOPED THIS?
It's something I use in my own personal trading. Developing in Visual
C++ with the Metastock Developer's Kit is something very few people
skills to perform and I thought I'd give something back to the rest of
the trading community. Perhaps you'll also consider subscribing to Premium
Data if you want reliable end-of-day data.
I do not intend to ever commercialise this plugin - I'm happy for
anybody and everybody to use it for free.
By using logical values for the ATR multiples, you can define your trading
style. For short-term trading, a trailing profit stop of 2 - 2.5 ATRs is useful.
For medium-long term trading, a trailing profit stop of 3-4 ATRs is useful.
The Advanced Stop system also allows you to plot a binary indicator
that will indicate which "stage" of the trade you're on (very
useful if you want to create an expert advisor).
The stages are:
0 - Not in a trade
1 - In trade, current stop being used is initial stop, trade
is still underneath transition point to breakeven stop.
2 - In trade, trailing
profit stop used
3 - In trade, price is past first pyramid point
4 - In trade, price is past second pyramid point
-1 - Trade stopped out on initial stop
-2 - Trade stopped out on trailing profit stop (or breakeven
stop if this is being used)
-3 - Trade stopped out on first pyramid trailing profit stop
-4 - Trade stopped out on second pyramid trailing profit stop.
This trade stage system is also fantastic if you are developing
trading systems with very specific defined entry points.
Check out the StageLong and StageShort functions.
The following examples are produced from Metastock v8, using
stock and futures data
from Premium Data.
Chart below shows standard trailing profit stop:
Chart below shows trailing profit stop on same stock but with
a different trailing profit
stop ATR multiple.
This chart shows the trailing profit stop on a short trade.
The chart below shows Crude Oil:
This chart shows Cisco on a long trade using the more advanced
Pyramid tightening stops.
Note: I manually drew in the points marked 1, 2, 3 & 4, to show
the pyramid points a little better for you.
After installation, a DLL file called AdvancedStop is stored
in your equis\metastock\external formula dlls directory. The
Advanced Stop DLL has four functions that can be called:
StopLong - the trailing profit stop on a long trade
StopShort - the trailing profit stop on a short trade
StageLong - the stage of the trade in a long trade
StageShort - the
stage of the trade in a short trade
All of the above functions take the following parameters:
Entry Condition - what causes an entry (eg. a particular date,
moving average crossover etc.)
at Entry - The stop point when you enter the trade
Transition to breakeven stop - The price at which you transition
to a breakeven point (calculated on day of entry) - set this to
if you do not want to use a breakeven stop.
Trailing Profit Stop - The value of the trailing profit stop, calculated
on each day of the trade.
First Pyramid Condition - The price at which you transition to
the first pyramid condition (calculated on day of entry). Set this
to 0 if you do not want to use a pyramid
Trailing Profit Stop at First Pyramid - The value of the trailing
profit stop, calculated on each day of the trade, after the first
pyramid point has been signalled. Set to 0 if you do not want to
Second Pyramid Condition - The price at which you transition to
the first pyramid condition (calculated on day of entry). Set this
to 0 if you do not want to use a pyramid
Trailing Profit Stop at Second Pyramid - The value of the trailing profit stop,
calculated on each day of the trade, after the second pyramid point has been
Set to 0 if you do not want to use this.
All of the above seems complex at first
sight! Luckily I've provided a few formulas that help you to plot the above
on a chart.
USAGE EXAMPLE - PLOT A TRAILING PROFIT STOP FROM A GIVEN DAY ONWARDS
entryday:=Input("Day of month",1,31,1);
entryprice:=Input("Entry Price (leave as zero for close
of the day)",0,5000,0);
entryprice2 := If(entryprice>0,entryprice,C);
initatr:=Input("Initial stop ATR multiplier",0.1,6,2);
trailatr:=Input("Trailing stop ATR multiplier from High",0.1,6,2.5);
fulldate := Year()+Month()/12+DayOfMonth()/365;
entry:= entryfulldate > Ref(fulldate,-1) AND entryfulldate <=
ExtFml( "AdvancedStop.StopLong", entry,entryprice2-initatr*ATR(10),0,H-trailatr*ATR(10),0,0,0,0);
Using the above code in a formula allows me to drag a simple
indicator on to the price chart, in much the same ways as you
put a moving average on the chart.
After dragging the indicator on to the chart, you will see:
So, all you do is enter in the date you entered the trade, the
price you entered (or 0 for the closing price) and the two multipliers
for the initial stop and trailing stop. After this, the trailing
stop will be plotted on your price chart just like the examples
I have included a few more indicators that can be dragged onto
the chart too - check out the code inside them for further details.
Trick used above: You'll notice I have some code in there to
calculate dates etc. I have used a little trick that allows the
trailing profit stop line to still be plotted even if you put
in an invalid date (eg. weekend). If I didn't use this, and an
invalid date was given, you'd have an 'invisible' indicator which
is rather difficult to remove from your chart.
FREQUENTLY ASKED QUESTIONS
What trailing stop values/multipliers should I use for trading <XYZ>?
The beauty of the above DLL is that you can try out different multiples
to suit your personal style of trading. Aggressive short-term
traders will generally use low multiples and longer-term traders
will use high multiples.
What entry conditions should I use?
Use the entry conditions contained within your written trading plan.
This Metastock Plugin is used for exits not for entries!
I used your trailing stop and it lost me money.
Firstly: I'll happily refund the money you paid me for the Advanced Trailing
Stop. Oh, that's right, you didn't pay anything.
Secondly: Grow up. Take responsibility for your own trading decisions.
Do not use something you don't fully understand. This is just a tool to
assist traders, not tell them what to do.
Thirdly: You must not have read the disclaimer below and when you
installed the plugin.
Are any of the indicators password protected?
None of indicators are password protected - you may edit and modify it
to suit your trading style.
I have a stop loss methodology that doesn't use ATRs. Can I use
this DLL to assist me?
Most certainly you can. The entire system is based on two types of
conditions - (a) conditions relative to the entry price (initial
stop & pyramid points) and (b) conditions relative to the
current day's price (trailing stops). These do not need to
be ATR based.
Send your questions to: email@example.com
Doesn't plot in the first few bars of a chart. For new IPOs etc. you will
need to wait until the ATR has valid values (eg. 10 day ATR requires 10 days
of chart information first).
Perhaps not a limitation - Intraday price movements are ignored. Therefore
if the close of the day doesn't go past your stop, it still considers that
you are in the trade.
I'm interested in your feedback. Let me know what you think of this Metastock add-in at
In this day and age of litigation, everybody wants to blame someone else
when things don't go to plan.
Richard Dale nor any associate
of his, is not permitted to provide personal securities recommendations. Therefore
that is either spoken, shown or implied within this web site, any downloaded
files, any links to other sites or communication related to this site will
not be taken as an investment recommendations or advice.
Before making an investment decision on the basis of any information received
from this web site or subsequent communications with Richard Dale or his associates,
I will consider with or without the assistance of a licensed securities adviser,
whether my application of the information is appropriate in light of my particular
investment needs, objectives and financial circumstances.
I understand and agree that Richard Dale nor any associate of his,
shall in no way be liable to myself or anyone else for any loss or injury
caused in whole or in part through any activity related to this web site.
In short, I guarantee that you will lose money in the market. If you do not
lose money in the market as a result of this web site or any tools that are
provided then give some of it to a charity.
Before you download, read the disclaimer above. You may only
download the following files if you agree to the disclaimer.
Now choose which version of Metastock you own:
AdvancedTrailingStop v1.1 for Metastock
v8.X or v9.X or v10.x (156K download)
AdvancedTrailingStop v1.1 for Metastock v7.X (155K download)
Note: I have been advised that AVG Antivirus 6.0.777 (Free Edition) with Virus Database 524 (Release date 14/10/2004) reports the above files as
containing a "Trojan Horse PSW.Bancban.2.1". The above files do NOT contain any trojan horse/spyware/viruses. If you see this error message, disable AVG while you're installing the plugin and turn it back on again aftewards.
Also, I recommend you contact Grisoft so they can fix their antivirus definitions.
The above files will automatically install the AdvancedStop
DLL into Metastock, along with the following Indicators:
MetaStock is a registered trademark of Equis International