//+------------------------------------------------------------------+ //| StrongDay+OCHL.mq4 | //| Copyright © 2005, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2005, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #property indicator_buffers 3 #property indicator_color1 Green #property indicator_color2 Red #property indicator_chart_window extern int HistCountBars=300; //стрим индикатор не по всей истории а только на определенное количество баров назад extern int DeltaBars=28; //количество баров для расчета средней длины свечи extern int MoreThen=60; //процент от средней длины свечи, который хотим использовать double CBuffer[]; double UpBuffer[]; double DownBuffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID); SetIndexArrow(0,225); SetIndexBuffer(0,UpBuffer); SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID); SetIndexArrow(1,226); SetIndexBuffer(1,DownBuffer); SetIndexStyle(2,DRAW_ARROW,STYLE_SOLID,1,Orange); SetIndexArrow(2,108); SetIndexBuffer(2,CBuffer); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=HistCountBars; double Sd; //---- // if(counted_bars>0) counted_bars--; // for(int i=HistCountBars; i>0; i--) { for(int i=0; i Sd && (MathAbs(Open[i+1]-Close[i+1])/MathAbs(High[i+1]-Low[i+1]))>0.4) CBuffer[i+1]=(Open[i+1]+Close[i+1]+High[i+1]+Low[i+1])/4; if (MathAbs(Open[i+1]-Close[i+1])> Sd && (MathAbs(Open[i+1]-Close[i+1])/MathAbs(High[i+1]-Low[i+1]))>0.4 && Open[i] > ((Open[i+1]+Close[i+1]+High[i+1]+Low[i+1])/4)) UpBuffer[i]=Low[i]-5*Point; if (MathAbs(Open[i+1]-Close[i+1])> Sd && (MathAbs(Open[i+1]-Close[i+1])/MathAbs(High[i+1]-Low[i+1]))>0.4 && Open[i] < ((Open[i+1]+Close[i+1]+High[i+1]+Low[i+1])/4)) DownBuffer[i]=High[i]+5*Point; } //---- return(0); } //+------------------------------------------------------------------+