以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  如何即时买入  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=67166)

--  作者:zhsii
--  发布时间:2014/7/9 9:54:52
--  如何即时买入
均线D1:MA(CLOSE,15)
均线D2:MA(CLOSE,5)

如何编写以下程序:
     在价格向上 触碰 均线D1时,即时买入;
     在价格向下触碰 均线D2时,即时卖出; 
      以上最好能以均线价格成交。


--  作者:jinzhe
--  发布时间:2014/7/9 10:00:23
--  

if cross(h,d1) then begin

      sellshort(1,0,market);

      buy(holding=0,1,market);

end

 

if cross(d2,l) then begin

     sell(1,0,market);

     buyshort(holding=0,1,market);

end


--  作者:jinzhe
--  发布时间:2014/7/9 10:00:47
--  

系统设置为1秒轮询


图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看