//+------------------------------------------------------------------+ //| Copyright © 2010, Ivan Kornilov| //| BarPoints.mq4| //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, Ivan Kornilov. All rights reserved." #property link "excelf@gmail.com" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Crimson #property indicator_color2 RoyalBlue extern double N=0.002; double shift; double UpPoints[]; double DownPoints[]; double Trand[]; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int init() { IndicatorBuffers(3); SetIndexStyle(0,DRAW_LINE,EMPTY,3); SetIndexBuffer(0,UpPoints); SetIndexStyle(1,DRAW_LINE,EMPTY,3); SetIndexBuffer(1,DownPoints); SetIndexBuffer(2,Trand); IndicatorDigits(Digits+3); SetIndexLabel(0,"Point Up"); SetIndexLabel(1,"Point Down"); SetIndexDrawBegin(0,1); SetIndexDrawBegin(1,1); if(Digits==4) { shift= N * 10; } else { shift=N; } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int deinit() { return(0); } double upLevel; double downLevel; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { 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(int i=limit; i>=0; i--) { Trand[i]=Trand[i+1]; if(Close[i]>High[i+1]+N) { Trand[i]=1; } if(Close[i]