//+------------------------------------------------------------------+ //| Ticks.mq4 | //| MetaQuotes | //| http://www.alpari-idc.ru/ru/experts/articles/ | //+------------------------------------------------------------------+ #property copyright "Rosh" #property link "http://www.alpari-idc.ru/ru/experts/articles/" #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 Navy //---- buffers extern int MaxDrawTicks=500; double ExtMapBuffer1[]; int myBars; int tickCounter; int delimeterCounter; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0, ExtMapBuffer1); SetIndexEmptyValue(0,0.0); Print("???????? ????"); for (int i=Bars-1;i>=0;i--) ExtMapBuffer1[i]=0.0; //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| ??????? ?????? | //+------------------------------------------------------------------+ void SetDelimeter() { //---- string delimeterDate=TimeToStr(Time[0]); if (myBars!=0) { Print("?????? ???????????"); int handle=WindowFind("Ticks"); if(!ObjectCreate(delimeterDate,OBJ_VLINE,handle,Time[0],0)) { Alert("???????? ??????? ???????? ??????????? ? ???? ", handle," ?? ??????? ",TimeToStr(CurTime())); Print("?????? ?",GetLastError(),", ??? ??????????? ",delimeterDate); } else { ObjectSet(delimeterDate,OBJPROP_COLOR,DarkGreen); ObjectSet(delimeterDate,OBJPROP_STYLE,STYLE_DASHDOT); ObjectsRedraw(); } } //---- return(0); } //+------------------------------------------------------------------+ //| ??????? ?????? | //+------------------------------------------------------------------+ void ShiftArray() { //---- int V_lines; string delimeterName; datetime firstTime; int BarFirstTime; if (tickCounter>2*MaxDrawTicks) { for (int i=tickCounter;i>=MaxDrawTicks;i--) ExtMapBuffer1[i]=0.0; tickCounter=MaxDrawTicks; } for(int cnt=tickCounter;cnt>0;cnt--) { ExtMapBuffer1[cnt]=ExtMapBuffer1[cnt-1]; } V_lines=ObjectsTotal(); for (int z=0;z