以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- [求助]跨周期引用公式问题 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=97347) |
-- 作者:jzjhm -- 发布时间:2016/5/12 14:53:25 -- [求助]跨周期引用公式问题 老师好; 我想15分钟周期交易,10穿20做多,但调用60分钟和30分钟是否也是多头或空头,下列公式1和公式2正确吗,你给看看,谢谢
//公式1: //ma10:ma(c,10); //ma21:ma(c,21); //c1:cross(ma10,ma21); //c2:cross(ma21,ma10); //公式2 sc_min30:stkindi(\'\',\'公式1.c1\',0,4); sc_min60:stkindi(\'\',\'公式1.c1\',0,5); xc_min30:stkindi(\'\',\'公式1.c2\',0,4); xc_min60:stkindi(\'\',\'公式1.c2\',0,5; if sc_min30 and sc_min60 then buy(holding=0,1,thisclose); if xc_min30 then sell(1,0,market); if xc_min30 and xc_min60 then buyshort(holding=0,1,thisclose); if sc_min30 then sellshort(1,0,market); |
-- 作者:jinzhe -- 发布时间:2016/5/12 14:57:39 -- 公式1你全注释掉了,等于没用 把公式里面的//都去掉 公式2写的可以 |