Input: Length(10), BrkOuts(2), TrailStp(6), exit_proft(1000);
Vars: HighChannel(0), LowChannel(0), BreakOutCounter(0), BreakUnderCounter(0);
HighChannel = Highest( High , Length )[1];
LowChannel = Lowest( Low , Length )[1];
If High > HighChannel then Begin
BreakOutCounter = BreakOutCounter+ 1;
BreakUnderCounter = 0;
End;
If Low < LowChannel then Begin
BreakUnderCounter = BreakUnderCounter + 1;
BreakOutCounter= 0;
End;
If BreakOutCounter >= BrkOuts then Begin
Buy this bar on Close;
BreakOutCounter = 1;
End;
If BreakUnderCounter >= BrkOuts then Begin
Sellshort this bar on Close;
BreakUnderCounter = 1;
End;
{Sell next bar at Lowest( Low , TrailStp ) Stop;
Buytocover next bar at Highest( High , TrailStp ) Stop;}
SetProfitTarget (exit_proft);