//+------------------------------------------------------------------+ //| RPoint v2.mq4 | //| Copyright © 2004-2008, Poul_Trade_Forum | //| Aborigen & Kharko | //| http://forex.kbpauk.ru/ | //+------------------------------------------------------------------+ #property copyright "Aborigen & Kharko" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Red //---- input parameters extern int ReversPoint=20; extern bool Sound=true; //---- buffers double RBuffer[]; int Trend=1,InTrend,ttime; double Points,Last_High, Last_Low=100000; datetime LastTimeHigh=0,LastTimeLow=0; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; if(Digits==5 || Digits==3) ReversPoint*=10; Points=MarketInfo (Symbol(), MODE_POINT); //---- indicator line SetIndexStyle(0,DRAW_SECTION,EMPTY,1,Tan); SetIndexBuffer(0,RBuffer); SetIndexEmptyValue(0,0); //---- name for DataWindow and indicator subwindow label short_name="RPoint v2"; IndicatorShortName(short_name); SetIndexLabel(0,short_name); //---- SetIndexDrawBegin(0,100); //---- return(0); } //+------------------------------------------------------------------+ //| Custor indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- TODO: add your code here //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(),i,shift,index; static int count=0; //---- TODO: add your code here if(counted_bars>0) counted_bars--; i=Bars-counted_bars; //---- array out of range fix if(counted_bars==0) i--; //---- for(shift=i; shift>=0;shift--) { if (Trend==1) { if (High[shift]>Last_High) { if(LastTimeHigh!=0) { index=iBarShift(NULL,0,LastTimeHigh); RBuffer[index]=0; } Last_High=High[shift]; RBuffer[shift]=Last_High; LastTimeHigh=Time[shift]; } if (Low[shift]Last_Low+ReversPoint*Points && LastTimeLow