//+------------------------------------------------------------------+ //| Bogie-Spread_Histogram-IND-v2.mq4 | //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, Bogie Enterprises" //---- indicator settings #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 Red double ExtMapBuffer[]; //---- int ExtCountedBars=0; int x; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { IndicatorShortName("Current Spread = "); SetIndexStyle(0,DRAW_HISTOGRAM); SetIndexDrawBegin(0,0); //---- indicator buffers mapping SetIndexBuffer(0,ExtMapBuffer); int dig=MarketInfo(Symbol(),MODE_DIGITS); if(dig==2) x=1; if(dig==3) x=10; if(dig==4) x=1; if(dig==5) x=10; } int start() { ExtCountedBars=IndicatorCounted()+1; if (ExtCountedBars<0) return(-1); if (ExtCountedBars>0) ExtCountedBars--; int i,pos=Bars-ExtCountedBars-1; while(pos>=0) { ExtMapBuffer[pos]=NormalizeDouble(MarketInfo(Symbol(),MODE_SPREAD)/x,1); pos--; } return(0); } //+------------------------------------------------------------------+