打印本文打印本文 关闭窗口关闭窗口

[求助]请老师帮忙写个模型代码

作者:金字塔 来源:cxh99.com 发布时间:2016年03月07日
  • 咨询内容: 请老师帮忙写个简单的均线模型:一分钟K线周期上用MA15做多空进场条件,当K线收盘价大于均线值5(N)个点则做多,相反则做空,固定下一手。如果盈利超过10点之后回撤达到3点,就平仓,保住盈利。超过10个点的盈利则采取移动止盈,回落至70%的时候平仓。若下单后行情即刻相反的话5个点止损出场。谢谢!!!

     

  • 金字塔客服: 处理中,请稍等

     

  • 用户回复: 老师期待ing............

     

  • 网友回复: 多头为例

    VARIABLE:n=0,m=0;
    ma15:ma(c,15);
    hh:hhv(h,enterbars+1);
    if c>ma15+5 then buy(holding=0,1,market);

    if h-enterprice>=3 and  h-enterprice<=10 then n:=1;
    if l-enterprice<=3 and n=1 then begin
     sell(holding>0,holding,market);
     n:=0;
     end
    if h-enterprice>10 then m:=1;
    if l-enterprice<=0.7*(hh-enterprice) and m=1 then begin
     sell(holding>0,holding,market);
     m:=0;
     end
     if enterprice-l>=15 then sell(holding>0,holding,market);

     

  • 网友回复:  
打印本文打印本文 关闭窗口关闭窗口