Автор:
Разместил:   Дата: 2006-01-15 06:50
Комментарии: (0)   Рейтинг:

The 2/20-day Ema breakout technique is represented below as both an indicator and a system. The system signals entry/exit points based on the ones specified by David Landry.


The Power Editor system code for the 2/20-day EMA breakout system offers an additional input called StpPnts. This input allows you to easily set the points above the high for the buy stop, or the points below the low for the sell stop.

Type: System, Name: Mov Avg X 2_20



Inputs: Price(Close), AvgLen(20), StpPnts(10);
Vars: AvgVal(0), Buyit(0), Sellit(0);
AvgVal = XAverage(Price, AvgLen);

{Buy/Sell Entry Setup}
IF Lowest(Low, 2) > AvgVal AND Low 1 Bar Ago Crosses Above AvgVal AND
MarketPosition <> 1 Then Begin
Buyit = Highest(High, 2) + StpPnts Points;
Condition1 = True;
End;
IF Highest(High, 2) < AvgVal AND High 1 Bar Ago Crosses Below AvgVal
AND
MarketPosition <> -1 Then Begin
Sellit = Lowest(Low, 2) - StpPnts Points;
Condition2 = True;
End;

{Buy/Sell Entry Orders}
IF Lowest(Low, 2) > AvgVal AND Condition1 Then
Buy Next Bar at Buyit Stop;
IF Highest(High, 2) < AvgVal AND Condition2 Then
Sell Next Bar at Sellit Stop;

{Long/Short Exits}
ExitLong Next Bar at AvgVal Stop;
ExitShort Next Bar at AvgVal Stop;

IF MarketPosition <> 0 Then Begin
Condition1 = False;
Condition2 = False;
End;




 
Реклама:

Rambler's Top100

Страница создана за 0.043 секунды