Вы находитесь на странице: 1из 1

ellStop(0), BuyLimit(0), SellLimit(0), tEnd(1700);

MP = MarketPosition;
{2. Time window filter; see below: 3.4, Inserting an intraday time filter}
tend=tset+WindowDist; {time window of 1 hour}
if time > tset - 5 and time < tend then begin
39Trading Systems
{3. Definition of moving averages and entry conditions}
Fast = Average(Close, FastLength);
Slow = Average(Close, SlowLength);
GoLong = Fast > Slow;
GoShort = Fast < Slow;
{4. Entry Setup}
If Fast crosses above Slow then begin
BuyStop = High + 1 point;
BuyLimit = High + 5 points;
end;
If Fast crosses below Slow then begin
SellStop = Low - 1 point;
SellLimit= Low - 5 points;
end;
If GoLong and C < BuyLimit then
Buy (Long) next bar at BuyStop Stop;
If GoShort and C > SellLimit then
Sell Short (Short) next bar at SellStop Stop;
{5. Exits: Derived from the slow moving average. These exits are not used here s
ince
we take different standard exits! Feel free to change the exits according to you
r needs}
{If MP = 1 then Begin
Sell next bar at Slow - 1 point Stop;
End;
If MP = -1 then Begin
Buy to Cover next bar at Slow + 1 point Stop;
End;}
end;