Author: Copyright � 2005, MetaQuotes Software Corp.
MRO2_v1

This tool is designed to analyze market price behavior by measuring volatility and relative movement. It helps traders understand the relationship between the "stretch" of current price action and the typical price fluctuations over a specific period.

How the Logic Works

The script operates by breaking down the market data into two main components: Average Volatility and Relative Movement.

1. Calculating Average Volatility First, the tool looks back at a user-defined number of recent price bars (set by the "period" parameter). It examines every single bar in that window to find the distance between the highest price reached and the lowest price reached. By adding these distances together and dividing them by the total number of bars, the script establishes a "baseline" for how much the market normally moves. This represents the standard "noise" or activity level of the asset.

2. Measuring Specific Price Movement While calculating that baseline, the tool simultaneously looks at two specific points in time very close to each other: the closing price of a bar from a few moments ago and the closing price of the bar immediately preceding it. It measures the exact distance moved between these two specific points.

3. Determining the Relative Strength The final result displayed on your chart is a calculation of how much that specific, short-term price move compares to the average volatility of the entire period.

By dividing the specific price movement by the average range, the tool produces a value that tells you whether the current price action is "normal" or "exceptional." If the result is high, it indicates that the price is moving much further than usual relative to its recent history; if it is low, the move is relatively insignificant compared to the general market activity.

Miscellaneous
Implements a curve of type %1
12 Views
0 Downloads
0 Favorites
MRO2_v1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                                         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