📅 财经日历 📊 实时波动 📈 大盘云图 📶 行情走势 🆚 投机情绪 🚀 今日热点

    Bull老大求解!!跪谢!!

    2011-10-19 · 8594 阅读
    Bull知道NonlagDOT这个指标是怎样计算出来的吗?小弟初学MQL,它的源代码看不太懂,还请各位高手指点一二。
      下面把指标的源代码粘贴上来,让大伙瞅瞅。
      
      //+------------------------------------------------------------------+
      //|                                                  NonLagDOT.mq4        |
      //+------------------------------------------------------------------+
      #property copyright
      #property link     
      
      #property indicator_chart_window
      #property indicator_buffers 3
      #property indicator_color1 Yellow
      #property indicator_width1 2
      #property indicator_color2 RoyalBlue
      #property indicator_width2 2
      #property indicator_color3 Red
      #property indicator_width3 2
      
      
      //---- input parameters
      extern int     Price          = 0;
      extern int     Length         = 10;
      extern int     Displace       = 0;
      extern int     Filter         = 0;
      extern int     Color          = 1;
      extern int     ColorBarBack   = 2;
      extern double  Deviation      = 0;         
      
      double Cycle =  4;
      
      //---- indicator buffers
      double MABuffer[];
      double UpBuffer[];
      double DnBuffer[];
      double price[];
      double trend[];
      
      //+------------------------------------------------------------------+
      //| Custom indicator initialization function                         |
      //+------------------------------------------------------------------+
        int init()
        {
         int ft=0;
         string short_name;
      //---- indicator line
         IndicatorBuffers(5);
         SetIndexStyle(0,DRAW_ARROW);
         SetIndexBuffer(0,MABuffer);
         SetIndexStyle(1,DRAW_ARROW);
         SetIndexBuffer(1,UpBuffer);
         SetIndexStyle(2,DRAW_ARROW);
         SetIndexBuffer(2,DnBuffer);
         SetIndexBuffer(3,price);
         SetIndexBuffer(4,trend);
         IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
         SetIndexArrow(0,159);
         SetIndexArrow(1,159);
         SetIndexArrow(2,159);
         SetIndexArrow(3,159);
      //---- name for DataWindow and indicator subwindow label
         short_name=\"NonLagDot(\"+Length+\")\";
         IndicatorShortName(short_name);
         SetIndexLabel(0,\"NLD\");
         SetIndexLabel(1,\"Up\");
         SetIndexLabel(2,\"Dn\");
      //----
         SetIndexShift(0,Displace);
         SetIndexShift(1,Displace);
         SetIndexShift(2,Displace);
         
         SetIndexDrawBegin(0,Length*Cycle+Length);
         SetIndexDrawBegin(1,Length*Cycle+Length);
         SetIndexDrawBegin(2,Length*Cycle+Length);
      //----
         return(0);
        }
      
      //+------------------------------------------------------------------+
      //| NonLagMA_v4                                                     |
      //+------------------------------------------------------------------+
      int start()
      {
         int    i,shift, counted_bars=IndicatorCounted(),limit;
         double alfa, beta, t, Sum, Weight, step,g;
         double pi = 3.1415926535;   
         
         double Coeff =  3*pi;
         int Phase = Length-1;
         double Len = Length*Cycle + Phase;  
         
         if ( counted_bars > 0 )  limit=Bars-counted_bars;
         if ( counted_bars < 0 )  return(0);
         if ( counted_bars ==0 )  limit=Bars-Len-1;
         if ( counted_bars < 1 )
         for(i=1;i=0;shift--)
         {        
         Weight=0; Sum=0; t=0;
             
            for (i=0;i 0) MABuffer[shift] = (1.0+Deviation/100)*Sum/Weight;
         
            if (Filter>0)
            {
            if( MathAbs(MABuffer[shift]-MABuffer[shift+1]) < Filter*Point ) MABuffer[shift]=MABuffer[shift+1];
            }
            
            if (Color>0)
            {
            trend[shift]=trend[shift+1];
            if (MABuffer[shift]-MABuffer[shift+1] > Filter*Point) trend[shift]= 1;
            if (MABuffer[shift+1]-MABuffer[shift] > Filter*Point) trend[shift]=-1;
               if (trend[shift]>0)
               {  
               UpBuffer[shift] = MABuffer[shift];
               if (trend[shift+ColorBarBack]
    ""
    还没有人打赏,支持一下
    回复

    举报

     

    回答|共 28 个

    信和赢汇1 LV5

    发表于 2012-11-22 01:12:18 | 显示全部楼层

    #无语  

    muc.〢、 LV4

    发表于 2012-11-22 01:12:18 | 显示全部楼层

    希望可以用些时间了~````  

    □o□ LV6

    发表于 2012-11-22 01:36:01 | 显示全部楼层

    不错,看看。  

    pap LV5

    发表于 2012-11-22 01:36:01 | 显示全部楼层

    我好想升级  

    肆无忌惮 LV6

    发表于 2012-11-22 01:36:01 | 显示全部楼层

    原来这样也可以  

    杨子 LV5

    发表于 2012-11-22 01:36:01 | 显示全部楼层

    都是那么过来的  

    陈陈美妆 LV5

    发表于 2012-11-22 01:36:01 | 显示全部楼层

    技术研究、交流QQ:1534564486  

    vojhi LV4

    发表于 2012-11-22 01:36:01 | 显示全部楼层

    世界上那些最容易的事情中,拖延时间最不费力。  

    wilf528 LV5

    发表于 2014-12-22 03:40:59 | 显示全部楼层

    没有使用说明书
    123下一页
    您需要登录后才可以回帖 登录 | 注册

    提醒: 禁止引战、谩骂、灌水内容

    微信二维码

    有问题联系客服