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;