//+------------------------------------------------------------------+ //| Volume_Weighted_MA.mq4 | //| StatBars TO | //| http://ridecrufter.narod.ru | //+------------------------------------------------------------------+ #property copyright "StatBars TO" #property link "http://ridecrufter.narod.ru" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 DeepPink extern int Period_MA=21; extern int Price_MA=PRICE_MEDIAN; double MABuffer[]; double Vol[1]; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { IndicatorBuffers(1); SetIndexDrawBegin(0,Period_MA); SetIndexBuffer(0,MABuffer); SetIndexStyle(0,DRAW_LINE); IndicatorDigits(Digits+1); ArrayResize(Vol,Period_MA); return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { int limit; int j,i; double sum; double Price; int counted_bars=IndicatorCounted(); if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; if(counted_bars==0) limit-=Period_MA; for(i=0; i