下面是代码 但是箭头离着均线很远 请大神给说一下怎样改代码能让箭头离均线进一些!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//+------------------------------------------------------------------+
//| 均线交叉.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);
}
//+------------------------------------------------------------------+
|