以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 求助 怎么写 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=95895) |
-- 作者:NashSc -- 发布时间:2016/4/6 16:58:43 -- 求助 怎么写 第1条均线M1 第2条均线M2 :
|
-- 作者:jinzhe -- 发布时间:2016/4/6 17:04:13 -- 每根K线只要碰到M1就做多 这个是指什么样的状态/ |
-- 作者:lixiu -- 发布时间:2016/4/6 18:11:49 -- 比如说五分钟图M1(5日均线)上穿M2(10日均线)了,就出买入信号;出买入信号的那根K线算起,后面的每根五分钟的K线价格只要碰到M1,就按M1的价格成交。就是说均线值是不断的变化和移动,就会对应出另外一根K线,如果这根K线(假设10:00整高开低收分别是14,12,10,13)没有碰到M1(假设是9)就不成交,如果下一根K线(假设10:05高开低收分别是14,12,10,13)又碰到M1(假设是11),就按11买入,以此类推 |
-- 作者:lixiu -- 发布时间:2016/4/6 18:12:55 -- 方便加您的QQ或者微信吗? |
-- 作者:jinzhe -- 发布时间:2016/4/7 9:04:26 -- 第1条均线M1 第2条均线M2 :
m1:=ma(c,5); m2:=ma(c,10);
if cross(m1,m2) then buy(holding=0,1,marketr); if holding>0 and h>=m1 and l<=m1 then buy(1,1,limitr,m1); if cross(m2,m1) then buyshort(holding=0,1,marketr); if holding<0 and h>=m1 and l<=m1 then buyshort(1,1,limitr,m1); if holding>0 and c<=hhv(h,enterbars+1)-p then sell(1,s,marketr); if holding<0 and c>=llv(l,enterbars+1)+p then sellshort(1,s,marektr); |