
等级: 新手上路
- 注册:
- 2022-8-14
- 曾用名:
|

楼主 |
发表于 2022-8-15 10:10
|
显示全部楼层
VARIABLE:qhh:=1,qll:=1,status:=0,maxh:=0,minl:=9999;
DIFF := EMA(CLOSE,12) - EMA(CLOSE,26);
DEA := EMA(DIFF,9);
MACD1 : =2*(DIFF-DEA);
VERTLINE( diff>0 and ref(diff,1)<0);
VERTLINE( diff<0 and ref(diff,1)>0);
shangchuan:=diff>0 and ref(diff,1)<0;
xiachuan:=diff<0 and ref(diff,1)>0;
q:=barpos;
if status = 1 then //上穿找最高点
BEGIN
if h > maxh then
BEGIN
maxh := h;
qhh := barpos;
END
END
if status = 2 THEN //下穿找最低点
BEGIN
if l < minl THEN
BEGIN
minl := l;
qll := barpos;
END
END
if SHANGCHUAN = 1 then BEGIN
status :=1;
DRAWLINE(BARPOS=QHH ,h , BARPOS=QLL, l, 0 );
maxh:=0;
end
if xiaCHUAN = 1 then BEGIN
status :=2;
DRAWLINE(BARPOS=QLL ,minl , BARPOS=QHH, maxh, 0 );
minl:=9999;
end
///////////////////////////////////////
这是全部代码 用的是逐K |
|