您需要 登录 才可以下载或查看,没有帐号?注册
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Silver
#property indicator_color2 Red
//---- input parameters
extern int Timeframe=0;
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
extern int applied_price=0;
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicator line
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexDrawBegin(1,SignalSMA);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexBuffer(1,ExtMapBuffer2);
//---- name for DataWindow and indicator subwindow label
switch(Timeframe)
{
case 1 : string TimeframeStr= Period_M1 break;
case 5 : TimeframeStr= Period_M5 break;
case 15 : TimeframeStr= Period_M15 break;
case 30 : TimeframeStr= Period_M30 break;
case 60 : TimeframeStr= Period_H1 break;
case 240 : TimeframeStr= Period_H4 break;
case 1440 : TimeframeStr= Period_D1 break;
case 10080 : TimeframeStr= Period_W1 break;
case 43200 : TimeframeStr= Period_MN1 break;
default : TimeframeStr= Current Timeframe
}
IndicatorShortName( MTF_MACD( +FastEMA+ , +SlowEMA+ , +SignalSMA+ ) ( +TimeframeStr+ )
}
//----
return(0);
//+------------------------------------------------------------------+
//| MTF MACD |
//+------------------------------------------------------------------+
int start()
{
datetime TimeArray[];
int i,limit,y=0,counted_bars=IndicatorCounted();
// Plot defined time frame on to current time frame
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),Timeframe);
limit=Bars-counted_bars;
for(i=0,y=0;i
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!