//+------------------------------------------------------------------+ //| AvgRangeM AvgRange.mq4 | //| Copyright © 2005, tageiger aka fxid10t@yahoo.com | //| /www.forex-tsd.com http://www.metatrader.org | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005, tageiger aka fxid10t@yahoo.com" #property link "http://www.metatrader.org http://www.forex-tsd.com" //---- #property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 Yellow #property indicator_color2 SpringGreen #property indicator_color3 Tomato #property indicator_style1 2 //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; double rng,sum_rng,avg_rng; double rng1,sum_rng1,avg_rng1; double rng2,sum_rng2,avg_rng2; double rng3,sum_rng3,avg_rng3; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMapBuffer1); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,ExtMapBuffer2); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,ExtMapBuffer3); //---- return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); rng=0;sum_rng=0;avg_rng=0; rng1=0;sum_rng1=0;avg_rng1=0; rng2=0;sum_rng2=0;avg_rng2=0; rng3=0;sum_rng3=0;avg_rng3=0; //---- for(int i=0;i