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

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

求修改K线离均线的距离

  [复制链接]
428 14
看好了是真的 发表于 2018-1-11 20:15:31 | 只看该作者 |阅读模式 打印 上一主题 下一主题
下面是代码  但是箭头离着均线很远  请大神给说一下怎样改代码能让箭头离均线进一些!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//+------------------------------------------------------------------+
//|                                                         均线交叉.mq4 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_plots   4
//--- plot Label1
#property indicator_label1  "Label1"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  2
//--- plot Label2
#property indicator_label2  "Label2"
#property indicator_type2   DRAW_LINE
#property indicator_color2  clrBlue
#property indicator_style2  STYLE_SOLID
#property indicator_width2  2
//--- plot Label3
#property indicator_label3  "Label3"
#property indicator_type3   DRAW_ARROW
#property indicator_color3  clrRed
#property indicator_style3  STYLE_SOLID
#property indicator_width3  2
//--- plot Label4
#property indicator_label4  "Label4"
#property indicator_type4   DRAW_ARROW
#property indicator_color4  clrWhite
#property indicator_style4  STYLE_SOLID
#property indicator_width4  2
//--- indicator buffers
double         Label1Buffer[];
double         Label2Buffer[];
double         Label3Buffer[];
double         Label4Buffer[];
datetime jincha=0;
datetime sicha=0;
extern int T1= 5;
extern int T2 = 10;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,Label1Buffer);
   SetIndexBuffer(1,Label2Buffer);
   SetIndexBuffer(2,Label3Buffer);
   SetIndexBuffer(3,Label4Buffer);
//--- setting a code from the Wingdings charset as the property of PLOT_ARROW
   PlotIndexSetInteger(2,PLOT_ARROW,233);
   PlotIndexSetInteger(3,PLOT_ARROW,234);
   SetIndexArrow(2,233);
   SetIndexArrow(3,234);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
      int limit=Bars-IndicatorCounted();
      for(int i=0;iBuffer2)&&(Buffer11[B]Buffer21))//死叉
       {
         if(i==0)
          {
            if(sicha!=Time[0])
            {
            Alert(Symbol()+"死叉");
            sicha=Time[0];
            }
          }
        Label4Buffer[i]=High[i]+100*Point;
       }
     }   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
收藏
收藏0
转播
转播
分享
分享
分享
淘帖0

精彩评论14

跳转到指定楼层
沙发
求学者 发表于 2018-1-11 21:30:52 | 只看该作者
很好很强大
板凳
求学者 发表于 2018-1-11 21:45:46 | 只看该作者
金币我来了……
地板
 楼主| 看好了是真的 发表于 2018-1-11 23:07:28 | 只看该作者

金币我来了……
5#
jueeee 发表于 2018-1-12 00:25:40 | 只看该作者
100*Point改成10*Point就够了
6#
一秒永恒 发表于 2018-1-12 01:52:52 | 只看该作者
很好很强大
7#
pylzw4023 发表于 2018-1-12 03:13:52 | 只看该作者

很好很强大
8#
panda88 发表于 2018-1-12 03:37:59 | 只看该作者
学习学习了
9#
mahuamin 发表于 2018-1-12 04:01:28 | 只看该作者
Label3Buffer[i]=Low[i]-100*Point;
Label4Buffer[i]=High[i]+100*Point;
100改小就好了
10#
notebooklw 发表于 2018-1-12 04:52:49 | 只看该作者
学习学习了
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

发布主题
阅读排行更多+

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