很有价值的多周期MACD
//+------------------------------------------------------------------+ #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 |
打赏
最新创建圈子
- 新闻EA运行效果图圈 2019-05-05
圈主:admin 帖子:1