Author: Copyright � 2005, MetaQuotes Software Corp.
MRO2_v2
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
MRO2_v2
//+------------------------------------------------------------------+
//|                                                         MRO2.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_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- input parameters
extern int       periodMRO2=7;
//---- buffers
double RatedRangeBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,RatedRangeBuffer);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   double Range,AvrRange;
   int shift,i;
   int    counted_bars=Bars-periodMRO2-1;
//---- TODO: add your code here
   for(shift=counted_bars;shift>=0;shift--)
     {
      Range=0.0;
      for(i=shift+1;i<=shift+periodMRO2;i++)
        {
         Range=Range+MathAbs(High[i]-Low[i]);
        }
      AvrRange=Range/periodMRO2;
      //RatedRangeBuffer[shift]=AvrRange/Point;
      RatedRangeBuffer[shift]=MathAbs(Close[shift+1]-Close[shift+4])/AvrRange;
     }
//----
   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 ---