- Katılım
- 23 Eki 2020
- Mesajlar
- 1,828
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 lowest low) and exit when the close crosses that. (Members of Chuck LeBeau's Traders Club will 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 and down (hence the Yo Yo name).
Name: Trading the Trend
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)
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 seems like a logical thing to do, and in fact I coded it that way at first. The problem is that the Expert Advisor always reverts to the default value (the System 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.
kaynak:
meta-formula
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 and down (hence the Yo Yo name).
Name: Trading the Trend
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)
- After closing the Indicator Builder click on the Expert Advisor (the guy in the bowler/derby hat).
- Click on New, then the Name tab, type in Trading the Trend.
- 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,
- Still on the Highlights tab, select the second line, click Edit, type in the name Downtrend, select Color Red, select Condition, type in C<=FmlVar("Trading the Trend","HiLimit"), click OK, and then click OK again.
- 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.
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 seems like a logical thing to do, and in fact I coded it that way at first. The problem is that the Expert Advisor always reverts to the default value (the System 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.
kaynak:
meta-formula