https://www.myziyuan.com/
- 00萨满祭司00
- //---- indicator settings#property indicator_separate_window#property indicator_buffers 4#property indicator_color1 Lime //bbMacd up#property indicator_color2 Magenta //bbMacd up#property indicator_color3 Blue //Upperband#property indicator_color4 Red //Lowerband//---- indicator parametersextern int FastLen = 12;extern int SlowLen = 26;extern int Length = 10;extern int barsCount = 400;extern double StDv = 2.5;//----int loopbegin;int shift;double zeroline;//---- indicator buffersdouble ExtMapBuffer1[]; // bbMacddouble ExtMapBuffer2[]; // bbMacddouble ExtMapBuffer3[]; // Upperband Linedouble ExtMapBuffer4[]; // Lowerband Line//---- buffersdouble bbMacd[];double Upperband[];double Lowerband[];double avg[];double bbMacdline;double sDev;double mean;double sumSqr;//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+int init() {//---- 6 additional buffers are used for counting. IndicatorBuffers(8); //---- drawing settings SetIndexBuffer(0, ExtMapBuffer1); // bbMacd line SetIndexStyle(0, DRAW_ARROW); SetIndexArrow(0, 108); IndicatorDigits(Digits + 1);//---- SetIndexBuffer(1, ExtMapBuffer2); // bbMacd line SetIndexStyle(1, DRAW_ARROW); SetIndexArrow(1, 108); IndicatorDigits(Digits + 1);//---- SetIndexBuffer(2, ExtMapBuffer3); // Upperband line SetIndexStyle(2, DRAW_LINE, STYLE_SOLID, 1); IndicatorDigits(Digits + 1);//---- SetIndexBuffer(3, ExtMapBuffer4); // Lowerband line SetIndexStyle(3, DRAW_LINE, STYLE_SOLID, 1); IndicatorDigits(Digits + 1);//---- SetIndexBuffer(4, bbMacd); SetIndexBuffer(5, Upperband); SetIndexBuffer(6, Lowerband); SetIndexBuffer(7, avg); //---- name for DataWindow and indicator subwindow label IndicatorShortName("BB MACD(" + FastLen + "," + SlowLen + "," + Length+")"); SetIndexLabel(0, "bbMacd"); SetIndexLabel(1, "Upperband"); SetIndexLabel(2, "Lowerband"); //---- initialization done return(0); }//+------------------------------------------------------------------+//| Custor indicator deinitialization function |//+------------------------------------------------------------------+int deinit() {//---- return(0); }//+------------------------------------------------------------------+//| Custom BB_MACD |//+------------------------------------------------------------------+int start() { int limit; int counted_bars = IndicatorCounted(); if(counted_bars 0) counted_bars--; if (barsCount > 0) limit = MathMin(Bars - counted_bars,barsCount); else limit = Bars - counted_bars;//---- for(int i = 0; i bbMacd[i+1]) ExtMapBuffer2[i] = EMPTY_VALUE; //---- if(bbMacd[i] < bbMacd[i+1]) ExtMapBuffer1[i] = EMPTY_VALUE; }//---- done return(0); }//+------------------------------------------------------------------+
- 2021-02-19 22:20:02
- 111
- 这个问题无法详细回答。一般方法是根据你给出的MT4公式及你的相应需求,重新编写指标。如果你给的不是公式,而是EA,或是其它公式(指其它软件的程式代码),还要去了解这个代码的思路和算法、功能,再结合你的需求进行改编。
- 2021-02-11 16:53:23
- bibila
- 怎么把源码插入 MT4软件里,用MT4自带的源码编译器编译,然后在MT4中,直接添加到图表即可。
- 2021-02-11 16:53:23