以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  请问软件自带的加密策略如何使用?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=81573)

--  作者:COMBOY
--  发布时间:2015/7/23 14:33:48
--  请问软件自带的加密策略如何使用?

图片点击可在新窗口打开查看此主题相关图片如下:qq图片2015072314331833.png
图片点击可在新窗口打开查看
如题,这个软件自带的策略如何使用?
--  作者:jinzhe
--  发布时间:2015/7/23 14:36:39
--  
仅供参考不做交易
--  作者:COMBOY
--  发布时间:2015/7/23 15:02:30
--  

请帮我修改下这段编码好么?开仓采用走完k线,平仓采用固定轮回的策略,好像加个REF()可以做到么?

 

就以这个为例好了

 

ma5:ma(close,m);
if cross(c,ma5) and time>091500 and time<151300 and holding=0 then buy(1,1,limitr,c),IGNORECHECKPRICE;//改为走完k线下单
if cross(ma5,c) and time>091500 and time<151300 and holding=0 then buyshort(1,1,limitr,c),IGNORECHECKPRICE;//改为走完k线下单

if holding<0 and enterprice-l>=mindiff*n then sellshort(1,1,limitr,enterprice-mindiff*n),IGNORECHECKPRICE;//固定轮询下单
if holding>0 and enterprice-h<=mindiff*n then sell(1,1,limitr,enterprice+mindiff*n),IGNORECHECKPRICE ;//固定轮询下单


--  作者:jinzhe
--  发布时间:2015/7/23 15:06:01
--  
if ref(cross(c,ma5),1) and time>091500 and time<151300 and holding=0 then buy(1,1,limitr,c),IGNORECHECKPRICE;//改为走完k线下单
if ref(cross(ma5,c),1) and time>091500 and time<151300 and holding=0 then buyshort(1,1,limitr,c),IGNORECHECKPRICE;//改为走完k线下单