0_MoR2a_001

Author: Wolfe
0_MoR2a_001

This tool is a custom technical analysis indicator designed to help traders visualize momentum and trend relationships within a single dedicated window. Rather than looking at standard price action directly, it processes the underlying strength of the market to identify specific patterns.

Core Logic Overview

The script operates by performing a multi-layered calculation on price data. It doesn't just show you where the price is; it transforms that price data into a momentum reading and then analyzes that momentum for trends.

How the Data is Processed

The logic follows a three-step sequence:

1. Momentum Tracking (RSI) The foundation of the tool is the Relative Strength Index (RSI). The script first calculates this momentum value to determine if an asset is being bought or sold aggressively relative to its recent history.

2. Smoothing the Momentum (Moving Averages) Instead of looking at the raw, often jagged RSI line, the script applies two different "Moving Averages" to the RSI data itself:

  • Fast Average: A shorter-term calculation that reacts quickly to changes in momentum.
  • Slow Average: A longer-term calculation that filters out "noise" to show the broader trend of the momentum.

3. The Ratio Calculation The final and most unique step of the logic is the creation of a Ratio. The script takes the Fast Average and divides it by the Slow Average (multiplied by 100). This result provides a specific percentage-based figure that represents the "distance" or "gap" between short-term momentum and long-term momentum.

Visual Output

The indicator displays four distinct components in your workspace:

  • RSI: The primary momentum line.
  • MA1 & MA2: The two smoothed average lines (the Fast and Slow trends).
  • Ratio: A dashed line representing the mathematical relationship between those two averages.

Summary for the Trader

In simple terms, this script allows you to see not just how fast the market is moving, but whether the current "speed" of the market is accelerating or decelerating compared to its recent past. By observing the gap between the average lines and the resulting Ratio, traders can better identify potential exhaustion points or shifts in market strength.

Indicators Used
Relative strength indexMoving average indicator
Miscellaneous
Implements a curve of type %1
12 Views
0 Downloads
0 Favorites
0_MoR2a_001
//+--------------------------------------------------------------+
//|                                                      MoR.mq4 |
//+--------------------------------------------------------------+
//mod20008fxtsd
#property copyright "Wolfe"
#property link "xxxxwolfe@gmail.com"

#property indicator_separate_window
#property indicator_level1  100
#property indicator_level2  80
#property indicator_level3  50
#property indicator_level4  20
#property indicator_buffers 4
#property indicator_color1 Black    //RSI
#property indicator_color2 Blue     //MA1
#property indicator_color3 Red      //MA2
#property indicator_color4 Green    //Ratio

int  RSI_Timeframe=0;//0=current chart,1=m1,5=m5,15=m15,30=m30,60=h1,240=h4,etc...
int  RSI_Period = 10;
int  RSI_Applied_Price = 0;//0=close, 1=open, 2=high, 3=low, 4=(high+low)/2, 5=(high+low+close)/3, 6=(high+low+close+close)/4
int  MA1_Period = 10;
int  MA1_Method = 1;// 0=SMA, 1=EMA, 2=SMMA, 3=LWMA
int  MA2_Period = 30;
int  MA2_Method = 1;// 0=SMA, 1=EMA, 2=SMMA, 3=LWMA

double RSI[],MA1_Array[],MA2_Array[],MR_Ratio[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators setting
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1); //RSI
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1); //EMA10
SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,1); //EMA30
SetIndexStyle(3,DRAW_LINE,STYLE_SOLID,2); //Ratio

SetIndexBuffer(0,RSI);
SetIndexLabel(0,"RSI");

SetIndexBuffer(1,MA1_Array);
SetIndexLabel(1,"MA1");

SetIndexBuffer(2,MA2_Array);
SetIndexLabel(2,"MA2");

SetIndexBuffer(3,MR_Ratio);
SetIndexLabel(3,"Ratio");

IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
IndicatorShortName("MoR");

return(0);
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
   int  counted_bars=IndicatorCounted();
   int  i,limit;

   if (counted_bars<0) return(-1);
   if (counted_bars>0) counted_bars--;
         limit=Bars-counted_bars;

   //+------------------------------------------------------------------+
   //| RSI |
   //+------------------------------------------------------------------+

 for(i=limit; i>=0; i--)
 RSI[i]= iRSI(NULL,RSI_Timeframe,RSI_Period,RSI_Applied_Price,i);
    
   //+------------------------------------------------------------------+
   //| EMA 10 & 30 |
   //+------------------------------------------------------------------+

 for (i=0; i<=limit; i++)      
 {
  
      MA1_Array[i] = iMAOnArray(RSI,0,MA1_Period,0,MA1_Method,i);
      MA2_Array[i] = iMAOnArray(RSI,0,MA2_Period,0,MA2_Method,i);
   
   //+------------------------------------------------------------------+
   //| Ratio of EMA 10 & 30 |
   //+------------------------------------------------------------------+
 
      if (MA2_Array[i]!=0)
      MR_Ratio[i] = MA1_Array[i] / MA2_Array[i] * 100;
   }
   
   //----
   return(0);
}

Comments