#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 Linen
#property indicator_color2 Red
#property indicator_color3 Red
#property indicator_color4 Lime
#property indicator_width1 2
#property indicator_width3 3
#property indicator_width4 3
#property indicator_color5 Red
#property indicator_color6 Green
#property indicator_width5 3
#property indicator_width6 3
extern int 变色均线=26;
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
extern int EMA1=60;
//---- indicator buffers
double M1[];
double M2[];
double M3[];
double M4[];
double duo[];
double kong[];
double MacdBuffer[];
double SignalBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- drawing settings
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexStyle(2,DRAW_ARROW);
SetIndexArrow( 2, 67);
SetIndexStyle(3,DRAW_ARROW);
SetIndexArrow( 3, 68);
//---- indicator buffers mapping
SetIndexBuffer(0,M1);
SetIndexBuffer(1,M2);
SetIndexBuffer(2,M3);
SetIndexBuffer(3,M4);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName(\"MA(\"+EMA1+\",\"+变色均线+\",)\");
//IndicatorShortName(\"MACD(\"+FastEMA+\",\"+SlowEMA+\",\"+SignalSMA+\")\");
SetIndexLabel(0,\"M1\");
SetIndexLabel(1,\"M2\");
SetIndexLabel(2,\"M3\");
SetIndexLabel(3,\"M4\");
SetIndexBuffer(4,duo);
SetIndexBuffer(5,kong);
SetIndexStyle(4,DRAW_LINE);
SetIndexStyle(5,DRAW_LINE);
SetIndexDrawBegin(4,变色均线);
SetIndexDrawBegin(5,变色均线);
IndicatorDigits(Digits);
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence |
//+------------------------------------------------------------------+
int start()
{
double temp0,temp1;
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- macd counted in the 1-st buffer
for(int i=0; i |