
等级: 新手上路
- 注册:
- 2023-1-19
- 曾用名:
|
老师你好 ,我的这个指标在日线级别本地预警及debugfell 输出始终没有信号,但是在图表示是有指标信号的,其他周期(一分钟到六十分钟)都是信号正常,请问是什么地方有错误
ma5:=ma(c,5);
ma10:=ma(c,10);
ma20:=ma(c,20);
ma30:=ma(c,30);
ma60:=ma(c,60);
l1:=min(min(min(ma10,ma20),ma30),ma60) ;
l2:=max(max(max(ma10,ma20),ma30),ma60) ;
a:ma5>l1&&(c< ref(c,1) || ref(c,1)< ref(c,2)
|| ma5<ma10 )&&(ma5>ma20
|| ma5>ma60) &&(( ( l1>( l-(hhv(h,5)-l)*0.15) and ref(c,1)> ref(l1,1) )
||( l<l1 and (ref(c,1)> ref(l1,1) || c>l1)))) ;
b:ma5<l2&&(c> ref(c,1) || ref(c,1)> ref(c,2)
|| ma5>ma10 )&&(ma5<ma20
|| ma5<ma60) &&(( ( l2<( h+(h-llv(l,5))*0.15) and ref(c,1)< ref(l2,1) )
||( h>l2 and (ref(c,1)< ref(l2,1) || c<l2)))) ;
sellcond:=a;
buycond:=b;
abb:time0-timetot0(dynainfo(207)),NODRAW;//K线结束倒计时 这里数值要和你选择的提前N秒保存一致
str1:STKLABEL&' '&NUMTOSTR(datatype,0)&' t1';
str2:STKLABEL&' '&NUMTOSTR(datatype,0)&' t2';
t1:extgbdata(str1);
t2:extgbdata(str2);
IF DATE<>REF(DATE,1) THEN BEGIN //全局变量置零
extgbdataset(str1,0);
extgbdataset(str2,0);
END
if sellcond and t1<time and abb<=5 then
begin
平预警:1;//预警条件1
extgbdataset(str1,time);
DEBUGFILE('D:\AAA\AAA.TXT',stklabel&' sellcond:%.0f'&' 周期类型='&NUMTOSTR(datatype,0),sellcond);
end
if buycond and t2<time and abb<=5 then
begin
开预警:1;//预警条件2
extgbdataset(str2,time);
DEBUGFILE('D:\AAA\BBB.TXT',stklabel&' BUYCON:%.0f'&' 周期类型='&NUMTOSTR(datatype,0),buycond);
end
|
|