//+------------------------------------------------------------------+ //| ËèíèèÊðóãëîéÖåíû.mq4 | //| Copyright © 2010, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2010, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ #property copyright "VadimVP" #property link "poluyan@fxmail.ru" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 White #property indicator_color2 White int Limit=10; int d; double buf_up[],buf_dn[],buf[]; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { SetIndexBuffer(0,buf_up); SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(1,buf_dn); SetIndexStyle(1,DRAW_LINE); SetIndexEmptyValue(0,EMPTY_VALUE); SetIndexEmptyValue(1,EMPTY_VALUE); return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { int i; int counted_bars=IndicatorCounted(); if(counted_bars<0) return(-1); if(counted_bars>0) counted_bars--; int limit=Bars-counted_bars; if(counted_bars==0) limit--; ArrayResize(buf,ArraySize(buf_up)); for(i=limit;i>=0;i--) { buf_up[i]=EMPTY_VALUE; buf_dn[i]=EMPTY_VALUE; buf[i]=EMPTY_VALUE; } if(Digits == 5) d = Digits - 3; if(Digits == 4) d = Digits - 2; for(i=limit;i>=0;i--) { buf_up[i]=MathCeil(Ask*MathPow(10,d))/MathPow(10,d); buf_dn[i]=(MathCeil(Ask*MathPow(10,d)*(-1))*(-1))/MathPow(10,d); } return(0); } //+------------------------------------------------------------------+