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

两仪四象TS进场交易系统源码代码

作者:开拓者 TB 来源:cxh99.com 发布时间:2012年11月26日
  •  参数:N1=10,N2=10
     

 

  • 源码:


    if(currentbar>maxlist(N1,N2)+1) then begin
      if Summation(absvalue(close-close[1]),N1)<>0 then begin
    EF=maxlist(highest(close,N1)-Lowest(close,N1),absvalue(close-close[N1]))/Summation(absvalue(close-close[1]),N1);
      end;
    EFMA=Average(EF,N1);
    MER=IntPortion(N1-(EFMA-0.5)*N2);
    LY=Summation((close-close[1])*Volume,MER);
    LYSX=Average(LY,N1);
    end;

    messagelog("LYSX",LYSX);
    messagelog("EF",EF);

    if (time>=opentime+maxlist(N1,N2)+1 and time<lasttime and marketposition=0 and tradeNumber<maxtime ) then
            begin
                    if LYSX>0 then begin
                    buy 1 share next bar at Open;
                    end;
                    if LYSX<0 then begin
                    sellshort 1 share next bar at Open;
                    end;
                   
                   
            end;

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