以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 反复开仓的问题,百思不得其解 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=12537) |
-- 作者:huifeng623 -- 发布时间:2012/6/21 10:04:29 -- 反复开仓的问题,百思不得其解 buyshort(holding=0 and ref(c,1)>junx and c<=junx and time>t and time<tt,jj,limitr,c); 反复开仓的交易记录在下面: |
-- 作者:just -- 发布时间:2012/6/21 10:08:26 -- buyshort(type(3)<>1 and ref(c,1)>junx and c<=junx and time>t and time<tt,jj,limitr,c); 改这样试试
|
-- 作者:huifeng623 -- 发布时间:2012/6/21 10:12:53 -- type(3)<>1,表示:前3次的信号不是开多? |
-- 作者:rushtaotao -- 发布时间:2012/6/21 10:14:43 -- 3是开空 得到当前位置之前上N次信号类型 |
-- 作者:just -- 发布时间:2012/6/21 10:15:36 -- 去看看TYPE函数的解释,type(3)<>1 表示之前无开空操作。 |
-- 作者:huifeng623 -- 发布时间:2012/6/21 10:18:23 -- 我想知道的是,我写的 buyshort(holding=0 and ref(c,1)>junx and c<=junx and time>t and time<tt,jj,limitr,c);
holding=0,为什么没起作用 |
-- 作者:rushtaotao -- 发布时间:2012/6/21 10:25:01 -- 你可以用cond:holdling=0 然后buyshort(cond,,)查下 你当前为止上cond是为1还是为0 是不是条件不对造成的 |
-- 作者:王锋 -- 发布时间:2012/6/21 10:26:53 -- 你所出现的问题可能是你的代码中不止一次的含有buyshort这个指令,其实你在图表上就应该能够看到有多次的开空行为,如果你查不到原因,你可以贴出你的代码,我们帮你看看 |
-- 作者:王锋 -- 发布时间:2012/6/21 10:37:22 -- 关于引用其他周期,信号消失问题
[此贴子已经被作者于2012-6-21 10:39:15编辑过]
|
-- 作者:huifeng623 -- 发布时间:2012/6/21 10:38:33 -- 在代码中,只出现了1次buyshort: buy(holding=0 and ref(c,1)<junx and c>=junx and time>t and time<tt,jj,LIMITr,c); sell(holding>0 and (c-ENTERPRICE>=a*zy or ENTERPRICE-c>=a*zs or time>=tt),holding,LIMITr,c); buyshort(holding=0 and type(1)<>3 and ref(c,1)>junx and c<=junx and time>t and time<tt,jj,limitr,c); sellshort(holding<0 and (ENTERPRICE-c>=a*zy or c-ENTERPRICE>=a*zs or time>=tt),holding,limitr,c); |