//+------------------------------------------------------------------+ //| 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<HistCountBars; i++) { Sd = 0; for (int j=1; j<=DeltaBars; j++) { Sd = Sd + MathAbs(Open[i+j]-Close[i+j]); } Sd = Sd/DeltaBars; Sd = (Sd*MoreThen)/100; 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) 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); } //+------------------------------------------------------------------+
Sample
Analysis
Market Information Used:
Series array that contains close prices for each bar
Series array that contains open prices of each bar
Series array that contains the highest prices of each bar
Series array that contains the lowest prices of each bar
Indicator Curves created:
Implements a curve of type DRAW_ARROW
Indicators Used:
Custom Indicators Used:
Order Management characteristics:
Other Features: