TFS System by Bryan Strain

Description

In Traders' Tips this month, we take a look at the trend-following system and its accompanying indicators as presented in "How To Get In With The Trend And Out At The End" by Bryan Strain in this issue.
A set of three indicators are used, and each contributes a criterion for entering the market. For the record, when I implemented this trend-following strategy in EasyLanguage, not all of my entries and exits coincided with those presented in the article.

Here is the EasyLanguage code for the three indicators that were described in the article, as well as the EasyLanguage code for the signal that is used to create the trading strategy. The indicators and the trading strategy are fairly straightforward. The properties for each indicator are presented after the EasyLanguage. The first indicator presented is the tether line indicator.

Type: Indicator, Name: TFS Tether Line
Input: Length(50);
Variables: HighVal(0), LowVal(0), Tether(0);

HighVal = Highest(High, Length);
LowVal = Lowest(Low, Length);
Tether = (HighVal + LowVal) / 2;

Plot1(Tether, "Tether");

Type: Indicator, Name: TFS Vol Osc Avg
Input: AvgLength(7);
Variables: VolAccum(0), VolOsc(0);

VolAccum = 0;

For value1 = 0 To AvgLength -1 Begin
If Close[value1] > Open[value1] Then
VolAccum = VolAccum + Volume[value1];
If Close[value1] < Open[value1] Then
VolAccum = VolAccum - Volume[value1];
End;

VolOsc = VolAccum / AvgLength;
Plot1(VolOsc, "Vol Osc");
Plot2(0, "ZeroLine");

Type: Indicator, Name: TFS MBO Indicator

Inputs: FastAvg(25), SlowAvg(200);
Variable: MBO(0);

MBO = Average(Close, FastAvg) - Average(Close, SlowAvg);

Plot1(MBO, "MBO");
Plot2(0, "ZeroLine");

Type: Signal, Name: TFS Signal

Inputs: TetherLen(50), OscAvgLength(7), MBOFastAvg(25), MBOSlowAvg(200);
Variables: MBO(0), Tether(0), VolAccum(0), VolOsc(0);

VolAccum = 0;
For value1 = 0 To OscAvgLength -1 Begin
If Close[value1] > Open[value1] Then
VolAccum = VolAccum + Volume[value1];
If Close[value1] < Open[value1] Then
VolAccum = VolAccum - Volume[value1];
End;

Tether = (Highest(High, TetherLen) + Lowest(Low, TetherLen)) / 2;
MBO = Average(Close, MBOFastAvg) - Average(Close, MBOSlowAvg);
VolOsc = VolAccum / OscAvgLength;

{Entry Conditions}
Condition1 = Close Crosses Above Tether;
Condition2 = VolOsc > 0;
Condition3 = MBO > MBO[1];

If Condition1 AND Condition2 AND Condition3 Then
Buy Next Bar at Market;

{Trailing Exit}
If Close Crosses Below Tether Then
ExitLong Next Bar at Market;

Download

Author/Source

http://www.traders.com
No votes yet