[MT4指标]macd主图变色指标
主图指标
mt4指标类型:趋势指标
是否能用在mt4手机版上:否
是否含有未来函数:无
//+------------------------------------------------------------------+
//| CoreWinTT 驽豚弪 锣? 篑镥躅? ? 箐圜?! :)
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 Aqua
#property indicator_width1 2
#property indicator_color2 Aqua
#property indicator_width2 2
#property indicator_color3 Magenta
#property indicator_width3 2
#property indicator_color4 Magenta
#property indicator_width4 2
#property indicator_color5 MediumPurple
#property indicator_width5 2
#property indicator_color6 MediumPurple
#property indicator_width6 2
extern int FastEMA = 12;
extern int SlowEMA = 29;
extern int SignalEMA = 9;
//---- buffers
double ExtMapBuffer1;
double ExtMapBuffer2;
double ExtMapBuffer3;
double ExtMapBuffer4;
double ExtMapBuffer5;
double ExtMapBuffer6;
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,2);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,2);
SetIndexBuffer(3,ExtMapBuffer4);
SetIndexStyle(4,DRAW_HISTOGRAM,STYLE_SOLID,2);
SetIndexBuffer(4,ExtMapBuffer5);
SetIndexStyle(5,DRAW_HISTOGRAM,STYLE_SOLID,2);
SetIndexBuffer(5,ExtMapBuffer6);
//----
return(0);
}
int start()
{
int i;
int counted_bars=IndicatorCounted();
//----
i=Bars-counted_bars-1;
while(i>=0)
{
double L_1 = iCustom(NULL,0,"b_v2_macd_osmax",FastEMA,SlowEMA,SignalEMA,1,2,i); //buy
double L_2 = iCustom(NULL,0,"b_v2_macd_osmax",FastEMA,SlowEMA,SignalEMA,1,1,i); //sell
if(L_1 != 0.0){ExtMapBuffer1=High;ExtMapBuffer2=Low;}
else{if(L_2 != 0.0){ExtMapBuffer3=High;ExtMapBuffer4=Low;}
else{ExtMapBuffer5=High;ExtMapBuffer6=Low;}}
i--;
}
//----
return(0);
}impulseMACD.jpg
发表于:2014-05-18 08:07只看该作者
2楼
:lol:lol
韬客社区www.talkfx.co
发表于:2017-08-11 09:33只看该作者
4楼
阅尽天下指标
韬客社区www.talkfx.co
发表于:2017-08-19 11:30只看该作者
5楼
谢谢楼主分享
韬客社区www.talkfx.co