Èý±¶²¨¶¯ÐÔ¸ú×Ùϵͳ£º WLD´úÂë
var Bar: integer;
var N: float;
PlotStops; //ÔÚÖ÷ͼ»æËðÖ¹µã£¬·½±ã¹Û²ì¡£
for Bar := 45 to BarCount - 1 do //WLDÖÐÿ¸öϵͳ±ØÐèÒª´ÓÒ»¸öÖ÷Ñ»·¿ªÊ¼¡£
begin
N := ATR( Bar, 10 );//¼ÆËãNÖµ
if not LastPositionActive then// ÅжÏ×î½üÍ·´çÊÇ·ñ»îÔ¾£¬ÒÔÈ·¶¨ÊÇ·ñ¹Òµ¥¡£
begin
BuyAtStop( Bar + 1, Highest( Bar, #High, 45), 'Buy');//STOP¹Òµ¥Âò½ø£¬¼Û¸ñ45иߡ£
end
else
begin
SellAtStop( Bar + 1, Highest( Bar, #High, 45)-3*N, LastPosition , 'Stop')//ËðÖ¹¼ÛÔÚ45иß-3*N¡£
end;
end;
·ÖÎö¼Ò
Input:ChannelUp(45),ATRPer(10),ATRMult(3);
TR :=max(high,close[1])-min(low,close[1]);
if barpos=ATRPer then
ATR:=ma(TR,ATRPer);
if barpos>=ChannelUp then begin
ATR:=((ATRPer-1)*ATR+TR)/ATRPer;
buyPoint:=hhv(high,ChannelUp);
sellPoint:=buyPoint-ATRMult*ATR;
if Holding = 0 then buy(100%,stop,buyPoint);
if Holding >0 then sell(100%,stop,sellPoint);
end;