Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共6 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:求教模型过滤问题

1楼
RogarZ 发表于:2012/5/2 15:00:37

 我用BOLL指标建立交易系统,想过滤信号,避免反复开平仓的问题,比如开仓后3根K线不再做交易(不平不开),3根K线后再起作用。
用exitbars信号就消失。求教改如何修改

 

我的代码:

MID :  MA(CLOSE,M);
UPPER: MID + N*STD(CLOSE,M);
LOWER: MID - N*STD(CLOSE,M);

//BOLL公式

cond1:=cross(c,lower) or cross(c,mid) or cross(c,upper);
//开多条件
cond2:=cross(lower,c) or cross(mid,c) or cross(upper,c);
//开空条件

if cond1 then
begin
sellshort(holding<0,0,mkt);//平空
buy(holding=0 ,2,mkt);//开多
end

if cond2 then
begin
sell(holding>0,0,mkt);//平多
buyshort(holding=0,2,mkt);//开空
end

 

2楼
just 发表于:2012/5/2 16:48:19

MID :=  MA(CLOSE,M);
UPPER:= MID + N*STD(CLOSE,M);
LOWER:= MID - N*STD(CLOSE,M);

//BOLL公式

cond1:=cross(c,lower) or cross(c,mid) or cross(c,upper);
//开多条件
cond2:=cross(lower,c) or cross(mid,c) or cross(upper,c);
//开空条件

if cond1 and enterbars>=3 then sellshort(holding<0,0,mkt);//平空
if cond1 then buy(holding=0 ,2,mkt);//开多


if cond2 and enterbars>=3 then sell(holding>0,0,mkt);//平多
if cond2 then buyshort(holding=0,2,mkt);//开空


 

3楼
RogarZ 发表于:2012/5/3 13:36:13
试了下  加了过滤信号 enterbars就一点信号都米了 求解
4楼
just 发表于:2012/5/3 13:41:15
有信号 楼主仔细检查一下你的代码
5楼
RogarZ 发表于:2012/5/3 14:23:59

嗯 有了
我想问下 为什么我写成

if cond1 and enterbars>=3 then
begin
sellshort(holding<0,0,mkt);//平空
buy(holding=0 ,2,mkt);//开多
end

if cond2 and enterbars>=3 then
begin
sell(holding>0,0,mkt);//平多
buyshort(holding=0,2,mkt);//开空
end

就没有信号呢 还请前辈分析下。我想了很久逻辑上觉得没问题啊~

 

6楼
just 发表于:2012/5/3 14:26:00

条件不满足,你都没开仓 哪里来的ENTERBARS

 

共6 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03516 s, 3 queries.