MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

Trading the Trend I
Trading the Trend (TTT) -- by Andrew Abraham,TASC Magazine 9/1998, was about
one form of stoploss exit: subtract some manipulation of the true range from the highest high (or add it to the lowestlow) and exit when the close crosses that. (Members of Chuck LeBeau's TradersClubwill recognise the "Chandelier Exit".)

THE CHANDELIER EXIT: The exit stop is placed at a multiple of average true ranges from the highest high or highest close since the entry of the trade. As the highs get higher the stop moves up but it never moves downward.

In MS 6.5 as a variable or custom indicator : DaysinTrade:= Barssince(previous composite entry criteria = 1)

THE YO YO EXIT: This exit is very similar to the Chandelier Exit except that the ATR stop is always pegged to the most recent close instead of the highest high. Since the closes move higher and lower, the stop also moves up anddown (hence the Yo Yo name).

Trading the Trend I

Pds:=21;
Mult:=3;
TruRan:=Mov(ATR(1),Pds,W)*Mult;
HiLimit:=HHV(H,Pds)-TruRan;
LoLimit:=LLV(L,Pds)+TruRan;
If(C>HiLimit,HiLimit,LoLimit)

 

e-w-Trading_the_Trend_I.gif
  1. After closing the Indicator Builder click on the Expert Advisor (the guy in the bowler/derby hat).
  2. Click on New, then the Name tab, type in Trading the Trend.
  3. Click on the Highlights tab, select the first line so that it is highlighted, click Edit, type in the name Uptrend, select Colour Blue, select Condition, type in C>FmlVar("Trading the Trend","HiLimit"), and click OK,
  4. Still on the Highlights tab, select the second line, click Edit, typein the name Downtrend, select Color Red, select Condition, type in C<=FmlVar("Trading the Trend","HiLimit"), click OK, and then click OK again.
  5. If you have a chart open that you want to use this on, click Attach, otherwise click Close. In the latter case, when you open a chart and plot the trendline, click on the Expert Advisor, select Trading the Trend, and click on Attach.

I've given the Expert steps in detail for any who may not be familiar with its use. To experiment with variations in the lookback periods and the multiplier you can do so in either the Indicator Builder, or right-click the indicator on the chart, select Properties, then the Formula tab, and make the changes (e.g. try a lookback period of 10, and a multiplier of 2.5). As implemented above, the Expert should change accordingly. This shows the trade-offs that have to be made
between near and distant stops. This is too rudimentary to be traded as a system - the whipsaws would chop you to pieces - but the exits should help to limit drawdowns.

A very similar stoploss is given in Chande & Kroll "The New Technical Trader", pp.167 - 169, "Volatility-Based Trailing Stops". My preference is to plot both the high and the low exit lines in contrasting colours, dispensing with the switch between them, and dispensing with the Expert. If anyone wants help with the code, just say so.

Assuming you entered everything exactly in both the Indicator Builder and the Expert Advisor, one question comes to mind. Did you decide to adapt the formula to MS v.6.5 and use an Input function for Pds and Mult? It seemslike a logical thing to do, and in fact I coded it that way at first. Theproblem is that the Expert Advisor always reverts to the default value (theSystem Tester does the same thing).

Thus if you used something like:

Pds:=Input("Lookback Periods?",1,1000,20)

and then when you applied it you changed the periods to 15, the Expert Advisor will still read 20. I hard-coded the Pds and Mult parameters for that reason.

From Harvey Pearce hhp@home.com

Source / From: TOP
http://www.guppytraders.com

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!