以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 请老师帮忙编写一下,谢谢了! (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=99168) |
-- 作者:c100011631 -- 发布时间:2016/6/20 13:50:59 -- 请老师帮忙编写一下,谢谢了! 请老师帮忙编写一下:
ma(c,5)金叉ma(C,60),建立2N手数多头仓位;当C跌破ma(C,60)时,平多仓N手; 当ma(c,5)死叉ma(C,60),建立2N手数空头仓位;当C上穿ma(C,60)时,平空仓N手;
谢谢老师了!~ |
-- 作者:jinzhe -- 发布时间:2016/6/20 13:58:26 -- ma5:=ma(c,5); ma60:=ma(c,60); if cross(ma5,ma60) then buy(holding=0,2*n,market); if holding>0 and cross(ma60,c) then sell(1,n,market); if cross(ma60,ma5) then buyshort(holding=0,2*n,market); if holding<0 and cross(c,ma60) then sellshort(1,n,market); |