在使用buy,sell等时如何过滤重复的信号?
例如:sell(a,0,market)
buyshort(b,1,market)
sellshort(c,0,market)
buy(d,1,market)
希望楼主可以学习一下置顶的视频教程http://www.weistock.com/bbs/dispbbs.asp?boardid=2&Id=185
金字塔公式编写与程式化交易设计指南http://www.weistock.com/bbs/dispbbs.asp?boardid=2&Id=370
系统全面的学习一下
提供个简单的均线例子,供楼主参考.
ma5:=ma(close,5);
ma15:=ma(close,15);
if CROSS(ma5,ma15) and time>090100 and time<145000 then
begin
sellshort(holding<0,1,thisclose);
buy(holding=0,1,thisclose);
end
if CROSS(ma15,ma5) and time>090100 and time<145000 then
begin
sell(holding>0,1,thisclose);
buyshort(holding=0,1,thisclose);
end
//收盘前5分钟平仓
if time > 145500 then
begin
sell(holding > 0, 0, thisclose);
sellshort(holding < 0, 0, thisclose);
end