- //+------------------------------------------------------------------+
- //| MW.mq4 |
- //| Copyright ?2008, MetaQuotes Software Corp. |
- //| [url]http://www.metaquotes.net[/url] |
- //+------------------------------------------------------------------+
- #property copyright "Copyright ?2008, MetaQuotes Software Corp."
- #property link "http://www.metaquotes.net"
- #property indicator_chart_window
- #property indicator_buffers 2
- #property indicator_color1 Green
- #property indicator_color2 Red
- double W[];
- double M[];
- double BufferW[];
- double BufferM[];
- //+------------------------------------------------------------------+
- //| Custom indicator initialization function |
- //+------------------------------------------------------------------+
- int init()
- {
- //---- indicator buffers mapping
- SetIndexBuffer(0,BufferW);
- SetIndexBuffer(1,BufferM);
- //---- indicators
- SetIndexStyle(0,DRAW_ARROW);
- SetIndexStyle(1,DRAW_ARROW);
- SetIndexArrow(0,217);
- SetIndexArrow(1,218);
- //---- name for DataWindow and indicator subwindow label
- IndicatorShortName("MW");
- SetIndexLabel(0,"买");
- SetIndexLabel(1,"卖");
- //----
- return(0);
- }
- //+------------------------------------------------------------------+
- //| Custom indicator deinitialization function |
- //+------------------------------------------------------------------+
- int deinit()
- {
- //----
- //----
- return(0);
- }
- //+------------------------------------------------------------------+
- //| Custom indicator iteration function |
- //+------------------------------------------------------------------+
- 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<limit; i++)
- M[i]=MathMax(Close[i],Open[i]);
- W[i]=MathMin(Close[i],Open[i]);
- Alert(GetLastError());
- //---- signal line counted in the 2-nd buffer
- for(i=0; i<limit-2; i++)
- {
- if( M[i+1]>M[i] && M[i+1]>M[i+2] )
- {
- BufferM[i]=High[i];
- }
- if( W[i+1]<W[i] && W[i+1]<W[i+2])
- {
- BufferW[i]=Low[i];
- }
- }
- //----
- return(0);
- }
- //+------------------------------------------------------------------+
- 能不能用mt4编写出这样的曲线EMA(MA(C,N),M)?
- 跪求代码解读注解 本人刚接触mql4,实在不懂,求大神或好心人帮忙解读代码
- 求好人帮忙把这几行通达信代码改成MQl语言,很感谢