Author: ??????? ????????
NR7-NR4
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
NR7-NR4

//+------------------------------------------------------------------+ 
//|                                                        NR7-NR4.mq4 | 
//|                                                 ??????? ???????? | 
//|                                                  nikki21@mail.ru | 
//+------------------------------------------------------------------+ 
#property copyright "??????? ????????" 
#property link      "nikki21@mail.ru" 

#property indicator_chart_window 
#property indicator_buffers 2 
#property indicator_color1 Red 
#property indicator_color2 Blue
#property indicator_width1 3
#property indicator_width2 3
//+------------------------------------------------------------------+ 
extern int       NarrowRange7=7; 
extern int       NarrowRange4=4; 
//+------------------------------------------------------------------+ 
double ExtMapBuffer1[]; 
double ExtMapBuffer2[];
//+------------------------------------------------------------------+ 
int init(){ 
  SetIndexStyle(0,DRAW_ARROW); 
  SetIndexArrow(0,135); 
  SetIndexBuffer(0,ExtMapBuffer1);
  SetIndexStyle(0,DRAW_ARROW);
  SetIndexEmptyValue(0,0.0); 
  SetIndexStyle(1,DRAW_ARROW); 
  SetIndexArrow(1,132); 
  SetIndexBuffer(1,ExtMapBuffer2);
  SetIndexStyle(1,DRAW_ARROW);
  SetIndexEmptyValue(1,0.0); 
  return(0); 
} 
//+------------------------------------------------------------------+ 
int start(){ 
  int i,j,pos; 
  for(i=Bars-IndicatorCounted()-1;i>=0;i--){
    if ((High[i]<High[i+1])&&(Low[i]>Low[i+1])){ 
       for(j=i+1;j<i+NarrowRange7;j++) 
    pos=i; 
         if ((High[j]-Low[j])<(High[i]-Low[i])) 
          pos=j; 
      if (pos==i) 
        ExtMapBuffer1[i] = High[i] + (High[i] - Low[i])/2; 
    }    
  } 
{ 
  int y,z,posx; 
  for(y=Bars-IndicatorCounted()-1;y>=0;y--){ 
    if ((High[y]<High[y+1])&&(Low[y]>Low[y+1])){ 
      posx=y; 
      for(z=y+1;z<y+NarrowRange4;z++) 
        if ((High[z]-Low[z])<(High[y]-Low[y])) 
          posx=z; 
      if (posx==y) 
        ExtMapBuffer2[y] = 4*Point+( High[y] + (High[y] - Low[y])/2); 
    }    
  } 
  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 ---