以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  如何过滤重复的信号?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=5296)

--  作者:豆芽
--  发布时间:2011/2/25 14:57:40
--  如何过滤重复的信号?

在使用buy,sell等时如何过滤重复的信号?

例如:sell(a,0,market)

        buyshort(b,1,market)

        sellshort(c,0,market)

        buy(d,1,market)


--  作者:fly
--  发布时间:2011/2/25 15:07:21
--  

希望楼主可以学习一下置顶的视频教程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