StrongDay+OCHL

Author: Copyright � 2005, MetaQuotes Software Corp.
StrongDay+OCHL
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
StrongDay+OCHL
//+------------------------------------------------------------------+
//|                                               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);
  }
//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---