Один из базовых вариантов асимметричной Turtle Trading System. Взят из форума Клуба трейдеров Чака ЛеБо.
{ Turtle Trading System
Strategy is used as a simple flag
0 = Trade on close
1 = Trade next open
2 = Trade intraday
The exit signal is, instead, a classic intraday breakout
Riccardo Ronco, 1999, London
rrb3@btinternet.com }
Input: Entry_L(20), Exit_L(10), Strategy(1);
If CurrentBar > 1 then begin
If Strategy = 0 then begin
If Close > Highest(High,Entry_L)[1] Then Buy on Close;
If Close < Lowest(Low,Entry_L)[1] Then Sell on Close;
end;
If Strategy = 1 then begin
If Close > Highest(High,Entry_L)[1] Then Buy at market;
If Close < Lowest(Low,Entry_L)[1] Then Sell at market;
end;
If Strategy = 2 then begin
Buy Highest(High,Entry_L) + 1 point stop;
Sell Lowest(Low,Entry_L) -1 point stop;
end;
{ now let's manage the exit... }
If marketposition = 1 then ExitLong Lowest(Low, Exit_L) -1 point
stop;
if marketposition = -1 then ExitShort Highest(High, Exit_L) + 1
point stop;
end;