帖子
作者
回复/查看
最后发表
2015-07-15 13:13
2015-06-14 22:42
2015-06-09 18:14
2015-06-06 16:50
2015-06-07 06:17
2015-06-07 06:14
2015-06-07 04:23
我搞定了,打开安装目录的metaeditor.exe,随便找个没用的指标,把下面的源码覆盖上去,重新编译生成后重启MT4就好了。其实这个指标也没啥用,就是比较好看。
//+------------------------------------------------------------------+
//| Custom MACD.mq4 |
//| Copyright ?0213, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "deville"
#property link "deville"
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Silver
#property indicator_color2 Blue
#property indicator_color3 Red
#property indicator_color4 Green
#property indicator_color5 Purple
#property indicator_width1 1
//---- indicator parameters
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
//---- indicator buffers
static double MacdBuffer;
static double FastEMAbuffer;
static double SlowEMAbuffer;
static double MacdBufferUp;
static double MacdBufferDown;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- drawing settings
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexStyle(1,DRAW_LINE);
SetIndexStyle(2,DRAW_LINE);
SetIndexStyle(3, DRAW_HISTOGRAM, EMPTY, 2, Red);
SetIndexStyle(4, DRAW_HISTOGRAM, EMPTY, 2, Green);
//---- indicator buffers mapping
SetIndexBuffer(0,MacdBuffer);
SetIndexBuffer(1,FastEMAbuffer);
SetIndexBuffer(2,SlowEMAbuffer);
SetIndexBuffer(3,MacdBufferUp);
SetIndexBuffer(4,MacdBufferDown);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("Deville_MACD("+FastEMA+","+SlowEMA+","+SignalSMA+")");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- 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; i=0)
{
MacdBufferUp=MacdBuffer;
MacdBufferDown=0;
Print ("MacdBufferUp is ",MacdBufferUp);
}
else
{
MacdBufferDown=MacdBuffer;
MacdBufferUp=0;
Print ("MacdBufferDown is ",MacdBufferDown);
}
}
//---- done
return(0);
}
2015-06-04 17:43
2015-06-04 05:12
2015-06-03 14:23