//+------------------------------------------------------------------+ //| round value.mq4 | //| Copyright © 2010, Korwin | //| korwin-kor@yandex.ru | //+------------------------------------------------------------------+ #property copyright "Copyright © 2010, Korwin" #property link "korwin-kor@yandex.ru" #property indicator_chart_window #property indicator_buffers 8 #property indicator_style1 2 #property indicator_style2 2 #property indicator_style3 2 #property indicator_style4 2 #property indicator_style5 2 #property indicator_style6 2 #property indicator_style7 2 #property indicator_style8 2 #property indicator_color1 DimGray #property indicator_color2 DimGray #property indicator_color3 DimGray #property indicator_color4 DimGray #property indicator_color5 DimGray #property indicator_color6 DimGray #property indicator_color7 DimGray #property indicator_color8 DimGray extern double Шаг = 0.005; extern int Длина_прорисовки = 500; double buf0[]; double buf1[]; double buf2[]; double buf3[]; double buf4[]; double buf5[]; double buf6[]; double buf7[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { IndicatorBuffers(8); //---- drawing settings SetIndexStyle(0,DRAW_SECTION); SetIndexStyle(1,DRAW_SECTION); SetIndexStyle(2,DRAW_SECTION); SetIndexBuffer(1,buf0); SetIndexBuffer(2,buf1); SetIndexBuffer(3,buf2); SetIndexBuffer(0,buf3); SetIndexBuffer(4,buf4); SetIndexBuffer(5,buf5); SetIndexBuffer(6,buf6); SetIndexBuffer(7,buf7); SetIndexEmptyValue(0,0.0); SetIndexEmptyValue(1,0.0); SetIndexEmptyValue(2,0.0); SetIndexEmptyValue(3,0.0); SetIndexEmptyValue(4,0.0); SetIndexEmptyValue(5,0.0); SetIndexEmptyValue(6,0.0); SetIndexEmptyValue(7,0.0); return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int i,pos; 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-=1+Длина_прорисовки+1; for(i=limit; i>=0; i--) { buf5[i]=NormalizeDouble(Close[0],2)+Шаг*3; buf3[i]=NormalizeDouble(Close[0],2)+Шаг*2; buf0[i]=NormalizeDouble(Close[0],2)+Шаг; buf1[i]=NormalizeDouble(Close[0],2); buf2[i]=NormalizeDouble(Close[0],2)-Шаг; buf4[i]=NormalizeDouble(Close[0],2)-Шаг*2; buf6[i]=NormalizeDouble(Close[0],2)-Шаг*3; if(buf1[i]>Close[0]) buf7[i]=NormalizeDouble(Close[0],2)-Шаг*4; if(buf1[i]