[MT4指标]Cronex Impulse CD Color指标
附图指标,Cronex Impulse CD Color指标
mt4指标类型:趋势指标
是否能用在mt4手机版上:否
是否含有未来函数:无
//+------------------------------------------------------------------+
//| Cronex Impulse CD Color.mq4 |
//| Copyright ? 2007, Cronex. |
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright ? 2008, Cronex"
#property link "http://www.metaquotes.net/"
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 SteelBlue
#property indicator_color2 DarkOrange
#property indicator_color3 Green
#property indicator_color4 Red
//---- indicator parameters
extern int SlowMA=34;
extern int FastMA=14;
extern int SignalMA=9;
//---- indicator buffers
double MacdDivrBuffer;
double SignalBuffer;
double CDDivrBuffUP;
double CDDivrBuffDN;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicator buffers mapping
SetIndexBuffer(0,MacdDivrBuffer);
SetIndexBuffer(1,SignalBuffer);
SetIndexBuffer(2,CDDivrBuffUP);
SetIndexBuffer(3,CDDivrBuffDN);
//---- drawing settings
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexStyle(1,DRAW_LINE);
SetIndexStyle(2,DRAW_HISTOGRAM);
SetIndexStyle(3,DRAW_HISTOGRAM);
SetIndexEmptyValue(0,0) ;
SetIndexEmptyValue(1,0) ;
SetIndexEmptyValue(2,0) ;
SetIndexEmptyValue(3,0) ;
IndicatorDigits(Digits);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("Cronex Impulse CD("+SlowMA+","+FastMA+","+SignalMA+")");
SetIndexLabel(0,"Impulse MACD");
SetIndexLabel(1,"Signal");
SetIndexLabel(2,"Impulse CD");
SetIndexLabel(3,"Impulse CD");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
double HiInd,LoInd,MasterInd,CDDivr;
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- macd counted in the 1-st buffer
for(int i=0; iHiInd)
MacdDivrBuffer=MasterInd-HiInd;
if(MasterInd (MacdDivrBuffer[i+1]-SignalBuffer[i+1]))CDDivrBuffUP=MacdDivrBuffer-SignalBuffer;
if((MacdDivrBuffer-SignalBuffer)< (MacdDivrBuffer[i+1]-SignalBuffer[i+1]))CDDivrBuffDN=MacdDivrBuffer-SignalBuffer;
}
//---- done
return(0);
}
//+------------------------------------------------------------------+Impulse_CDC.jpg
发表于:2014-05-18 08:09只看该作者
2楼
:lol:lol
韬客社区www.talkfx.co