以下是我的策略,分析周期是30分钟,走完一根K线,范围是所有上海A股,提前200秒下单,从9:00启动交易,到10:40没有一个预警,改为固定时间间隔后,立即收到近70个预警。有什么设置不对吗?
Diff30:=stkindi('','macd.diff',0,4);//30分钟 diff值
Dea30:=stkindi('','macd.dea',0,4);//30
分钟dea值
Macd30:=stkindi('','macd.macd1',0,4);//30分钟macd值
Macd60:=stkindi('','macd.macd1',0,5);//60分钟macd值
If cross(diff30,dea30) and macd30>0.007 and tbuyholding(1)=0
then BEGIN
tbuy(1,10000/close,mkt);
SENDMAIL(1,'13913992413@139.COM',
STKLABEL & STKNAME & NUMTOSTR(CLOSE,2)& '《买》_【普14】','');
end
If macd60<ref(macd60,1) and tbuyholding(0)>0
then BEGIN
tsell(1,0,mkt);
SENDMAIL(1,'13913992413@139.COM',
STKLABEL & STKNAME & NUMTOSTR(CLOSE,2)& '《卖》_【普14】','');
End
debugfile('d:\test.txt',
STKLABEL +'diff30 = %.2f',diff30);
debugfile('d:\test.txt',
STKLABEL +'dea30 = %.2f',dea30);
debugfile('d:\test.txt',
STKLABEL +'macd30 = %.2f',macd30);
debugfile('d:\test.txt',
STKLABEL +'金叉判断 = %.0f',cross(diff30,dea30));
debugfile('d:\test.txt',
STKLABEL +'macd30>0.007判断 = %.0f',macd30>0.007);
此主题相关图片如下:捕获11.png
此主题相关图片如下:捕获12.png
说明在k线走完前200秒,没有股票满足预警条件
你再把提前下单的设置截图发一下