RZI
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
RZI
//+------------------------------------------------------------------+
//|                                                        RZI:).mq4 |
//|                                   Copyright © 1895, Prosto_Daun. |
//|                                              http://www.p_sec.eu |
//+------------------------------------------------------------------+
#property  copyright "Vasya_Daun © Corp"
#property  link      "http://www.p_sec.eu"
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Black

//---- buffers
double ExtMapBuffer1[];

//----
int ExtCountedBars=0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,0,1,Black);
   SetIndexBuffer(0,ExtMapBuffer1);
 

//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   if(Bars<=10) return(0);
   ExtCountedBars=IndicatorCounted();
//---- check for barsible errors
   if (ExtCountedBars<0) return(-1);
//---- last counted bar will be recounted
   if (ExtCountedBars>0) ExtCountedBars--;
   int bar=Bars-ExtCountedBars-1;
   
   while(bar>=0)
     {

   	if (High [bar] > High [bar+1] && Low [bar]> Low [bar+1])// 1
   	  	{
         ExtMapBuffer1[bar]=1+ExtMapBuffer1[bar+1];
         
           
         }
      else
         {
            if (High[bar]<High[bar+1] && Low[bar]< Low[bar+1])// -1
	     	     {
               ExtMapBuffer1[bar]=ExtMapBuffer1[bar+1]-1;
               
                      
	  	        }
            else
            {
               ExtMapBuffer1[bar]=ExtMapBuffer1[bar+1];
               
            }
          }
      
       
 	   bar--;
     }
  
   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 ---