//+------------------------------------------------------------------+ //| ma Navel price | //| | //+------------------------------------------------------------------+ //ideas: Bookkeeper (08.01.2009) BO.mq4 NavelSMA.mq4 //http://codebase.mql4.com/ru/5115 //2009fxtsd ki #property copyright "" #property link "" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Green #property indicator_width1 1 extern int ma_period = 14; extern int ma_method = 0; extern int ma_shift = 0; extern int ma_price = 8; extern string note__Price ="0C 1O 2H 3L 4Md 5Tp 6WghC: 4Md(HL/2),5Tp(HLC/3),6Wgh(HLCC/4)"; extern string _______ ="7 HA close: haC =(O+H+L+C)/4"; extern string ___ ="8 Navel SMA price: nvC =(2O+H+L+5C)/9"; double buffer1[]; double price[]; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { IndicatorBuffers(2); SetIndexStyle(0,DRAW_LINE); SetIndexShift(0,ma_shift); SetIndexBuffer(0,buffer1); SetIndexBuffer(1,price); string shortnme; shortnme = "MA Navel Price ("+ma_period+","+ma_method+", pr "+ma_price+") "; IndicatorShortName(shortnme); SetIndexLabel(0,shortnme); return(0); } int deinit() { return(0); } //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); int limit,i; if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; for(i=limit; i>=0; i--) { if (ma_price<0 || ma_price>8) ma_price=0; if (ma_price==7) price[i]=(Close[i]+Open[i]+High[i]+Low[i])/4; if (ma_price==8) price[i]=(Close[i]*5+Open[i]*2+High[i]+Low[i])/9; } for(i=limit; i>=0; i--) { if (ma_price<7) buffer1[i] = iMA(NULL,0,ma_period,0,ma_method,ma_price,i); else buffer1[i] = iMAOnArray(price,0,ma_period,0,ma_method,i); } return(0); }
Sample
Analysis
Market Information Used:
Series array that contains close prices for each bar
Series array that contains the highest prices of each bar
Series array that contains the lowest prices of each bar
Series array that contains open prices of each bar
Indicator Curves created:
Implements a curve of type DRAW_LINE
Indicators Used:
Moving average indicator
Custom Indicators Used:
Order Management characteristics:
Other Features: