以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://www.weistock.com/bbs/index.asp)
--  金字塔软件问题提交  (http://www.weistock.com/bbs/list.asp?boardid=2)
----  指标编写  (http://www.weistock.com/bbs/dispbbs.asp?boardid=2&id=76177)

--  作者:q835560665
--  发布时间:2015/3/5 12:31:19
--  指标编写

CCI指标

 

TYP := (HIGH + LOW + CLOSE)/3;
(TYP-MA(TYP,M))/(0.015*AVEDEV(TYP,M));

 

请问如何编写,当CCI指标线 大于0轴线时平空开多,小于时平多开空?


--  作者:pyd
--  发布时间:2015/3/5 13:04:46
--  

TYP : (HIGH + LOW + CLOSE)/3;
cci:(TYP-MA(TYP,M))/(0.015*AVEDEV(TYP,M)),NOAXIS;
if cci>0 then begin
sellshort(holding<0,holding,market);
buy(holding=0,1,market);
end
if cci<0 then begin
sell(holding>0,holding,market);
buyshort(holding=0,1,market);
end

[此贴子已经被作者于2015/3/5 13:26:37编辑过]