以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 求助 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=6024) |
-- 作者:cpgly -- 发布时间:2011/4/5 13:30:14 -- 求助 if holding=0 then begin 这样写有错吗,但是怎么显示的信号跟我想的不一样,我写的是创N日新高新低的信号,结果不是,测试结果也跟简单图标交易的差很多 [此贴子已经被作者于2011-4-5 13:32:47编辑过]
|
-- 作者:阿火 -- 发布时间:2011/4/5 16:48:11 -- hh:=ref(hhv(h,20),1); ll:=ref(llv(l,20),1); buycond:=c>hh; sellcond:=c<ll; if buycond then begin sellshort(holding<0,1,thisclose);//创新高时,如果有空单则买入平仓 buy(holding=0,1,thisclose);//创新高时,如果没有持仓则买入开仓 end
if sellcond then begin sell(holding>0,1,thisclose);//创新低时,如果有多单则卖出平仓 buyshort(holding=0,1,thisclose);//创新低时,如果没有持仓则卖出开仓 end
请参看以上模板编写 |
-- 作者:cpgly -- 发布时间:2011/4/5 17:35:29 -- longcon:=h>hh and aa>0; shortcon:=l<ll and aa<0; if h>hh then sellshort(holding<0,holding,thisclose); if longcon then buy(1,30%,thisclose); if l<ll then sell(holding>0 ,holding,thisclose); if shortcon then buyshort(1,30%,thisclose); 我这样写可以吧,但是图表怎么没有箭头之类的指示呢? |
-- 作者:阿火 -- 发布时间:2011/4/5 18:59:40 -- 1,把变量调试出来看看是否成立 2,如果变量成立却没有信号,请查看一下费率设置的问题 3,把资金量调大 |