比特币通信协议 - 币圈消息

比特币通信协议篇11、二、TURN简介。在典型的情况下,TURN客户端连接到内网中,并且通过一个或者多个NAT到 详细

来自外网的一个指标

[复制链接]
168 0
sdyc 发表于 2018-1-11 16:50:07 | 只看该作者 |阅读模式 打印 上一主题 下一主题
上次上传了一个指标,被取消了精华,心中甚是烦恼,这次指标 保证可以使用,信号明显,指标取消收费,并且公布主图全部源码:#property  indicator_chart_window
#property  indicator_buffers 4            
#property indicator_color1 Red      
#property indicator_color2 Red
#property indicator_color3 Blue
#property indicator_color4 Blue
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 2
#property indicator_width4 2
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
//int width;
extern int Rperiod = 15;
extern int LSMA_Period = 5;
extern int Shift_=0;
extern int     TimeFrame = 0;
extern string  note_TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN";
int Draw4HowLong;
int shift;
int i;
int j;
int loopbegin;
int length;
int lsma_length;
double lengthvar;
double tmp ;
double tmp2 ;
double wt[];
double sum[];
double lsma_sum[];
double lsma_ma[];
double middle[];
int c;
string IndicatorFileName;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- 7 additional buffers are used for counting.
   IndicatorBuffers(7);   
//---- drawing settings
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(2,ExtMapBuffer3);
   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(3,ExtMapBuffer4);
   SetIndexStyle(3,DRAW_LINE);
        if(TimeFrame==0) TimeFrame = Period();
//
   SetIndexShift(0,Shift_*TimeFrame/Period());
   SetIndexShift(1,Shift_*TimeFrame/Period());
   SetIndexShift(2,Shift_*TimeFrame/Period());
   SetIndexShift(3,Shift_*TimeFrame/Period());
   SetIndexLabel(1,"TL("+Rperiod+"|"+LSMA_Period+")["+TimeFrame+"]");
   SetIndexLabel(2,"TL("+Rperiod+"|"+LSMA_Period+")["+TimeFrame+"]");
   SetIndexBuffer(4,sum);        
   SetIndexBuffer(5,wt);         
   SetIndexBuffer(6,lsma_ma);
    IndicatorShortName("TriggL ("+Rperiod+"|"+LSMA_Period+")["+TimeFrame+"] ");  
      if (TimeFrame = 0; shift--)  //  MAIN For Loop
      {
         sum[1] = 0;                                             
         for(i = length; i >= 1  ; i--)             //LSMA loop
         {
         lengthvar = length + 1;                               //lengthvar = 21  
         lengthvar /= 3;                                       //lengthvar = 7
         tmp = 0;
         tmp = ( i - lengthvar)*Close[length-i+shift];         //tmp = 20 - 7 * close[20-i+shift]
         sum[1]+=tmp;
         }
         wt[shift] = sum[1]*6/(length*(length+1));  
         j = shift;
         lsma_ma[shift] = wt[j+1] + (wt[j]-wt[j+1])* 2/(lsma_length+1);
//========== COLOR CODING ===========================================                       
            ExtMapBuffer1[shift] = wt[shift];
            ExtMapBuffer2[shift] = lsma_ma[shift];
            ExtMapBuffer3[shift] = wt[shift];
            ExtMapBuffer4[shift] = lsma_ma[shift];
            if (wt[shift]  < lsma_ma[shift])
            {
                ExtMapBuffer4[shift] = EMPTY_VALUE;
                ExtMapBuffer3[shift] = EMPTY_VALUE;
           }         
        }
  }
//+------------------------------------------------------------------+
收藏
收藏0
转播
转播
分享
分享
分享
淘帖0
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

发布主题
阅读排行更多+

Powered by 顺水鱼MT4外汇EA网! X3.2© 2001-2017 顺水MT4外汇EA公司.( 陕ICP备17014341号-1