RSIOMA_v3LMA
Download scriptThis tool is designed to provide a smoothed and refined view of market momentum by layering multiple layers of mathematical analysis. Instead of looking at raw price data directly, it processes the information through three distinct stages to filter out "noise" and highlight significant trends.
How the Logic Works
The script operates using a three-step filtering process:
1. Initial Smoothing (Price to Moving Average) First, the tool takes the standard closing prices of an asset and converts them into a Moving Average. This initial step helps stabilize the data by smoothing out minor, erratic price fluctuations that often occur in volatile markets.
2. Momentum Calculation (Moving Average to RSI) Rather than calculating a standard Relative Strength Index (RSI) from raw prices, this script calculates the RSI based on the smoothed moving average created in the first step. This ensures that the momentum reading is derived from a more stable trend line rather than individual price spikes.
3. Trend Refinement (RSI to Moving Average) Finally, the script applies a second moving average to the resulting RSI data. This creates a "signal" line that represents the overall trend of the momentum.
Key Features for the User
- Reduced Noise: By applying moving averages both before and after the momentum calculation, the indicator is designed to ignore insignificant market "jitters," making it easier to identify sustained shifts in trend.
- Visual Guidance: The script plots two primary lines on a separate window:
- The Rsioma Line: Represents the core smoothed momentum.
- The MaRsioma Line: Acts as a secondary signal line that helps traders see where the momentum is accelerating or decelerating.
- Reference Levels: The indicator includes several horizontal reference levels (such as 20, 30, 50, 70, and 80). These provide visual boundaries to help identify overbought or oversold conditions more clearly than a standard RSI would allow.
In summary, this script functions as a "triple-filtered" momentum oscillator. It transforms raw price data into a stabilized moving average, converts that average into a momentum reading, and then smooths that reading once more to produce a clear, readable trend signal.
//+----------------------------------------------------------------------------------+
//| RSIOMA_v3LMA by Mladen & fxbs Kalenzo | fxtsd.com |ik|
//| Hornet(RSIOnArray) 2007, FxTSD.com MetaQuotes Software Corp. |
//| //Hist & Levels 20/80;30/70 CrossSig web: http://www.fxservice.eu |
//| //Rsioma/MaRsioma X sig () email: bartlomiej.gorski@gmail.com |
//+----------------------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/ Kalenzo|bartlomiej.gorski@gmail.com "
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_minimum -20
#property indicator_maximum 110
#property indicator_color1 Blue
#property indicator_color2 BlueViolet
//
#property indicator_width1 2
//
#property indicator_level1 100
#property indicator_level2 80 //76.4
#property indicator_level3 70 //61.8
#property indicator_level4 50
#property indicator_level5 30 //38.2
#property indicator_level6 20 //23.6
#property indicator_levelcolor DarkSlateGray
//------------------------------------------
//---- input parameters
//
extern int RSIOMA = 14;
extern int RSIOMA_MODE = MODE_EMA;
extern int RSIOMA_PRICE = PRICE_CLOSE;
extern int Ma_RSIOMA = 21;
extern int Ma_RSIOMA_MODE = MODE_EMA;
//
extern int BarsToCount = 500;
//---- buffers
//
//
// "indexes"
//
double MABuffer1[];
double RSIBuffer1[];
//
//
// indexes
//
//
double RSIBuffer[];
double marsioma[];
//
//
//
//
//
int correction;
datetime lastBarTime;
string short_name;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
short_name = StringConcatenate("RSIOMA[",RSIOMA,"](",Ma_RSIOMA,")");
IndicatorShortName(short_name);
//
//
//
//
//
SetIndexBuffer(0,RSIBuffer);
SetIndexBuffer(1,marsioma);
//
//
SetIndexLabel(0,"Rsioma("+RSIOMA+")");
SetIndexLabel(1,"MaRsioma("+Ma_RSIOMA+")");
//
//
// additional buffer(s)
//
//
correction = RSIOMA+RSIOMA+Ma_RSIOMA;
BarsToCount = MathMin(Bars,MathMax(BarsToCount,300));
ArrayResize( MABuffer1 ,BarsToCount+correction);
ArrayResize( RSIBuffer1,BarsToCount+correction);
ArraySetAsSeries(MABuffer1 ,true);
ArraySetAsSeries(RSIBuffer1,true);
lastBarTime = EMPTY_VALUE;
//
//
//
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start()
{
static bool init=false;
int counted_bars=IndicatorCounted();
int limit,i=0;
//
//
//
if(counted_bars<0) return(-1);
if(lastBarTime != Time[0]) {
lastBarTime = Time[0];
counted_bars = 0;
}
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
limit=MathMin(limit,BarsToCount+correction);
//
//
//
for(i=limit;i>=0;i--)
MABuffer1[i] = iMA(Symbol(),0,RSIOMA,0,RSIOMA_MODE,RSIOMA_PRICE,i);
for(i=limit;i>=0;i--)
RSIBuffer1[i] = iRSIOnArray(MABuffer1,0,RSIOMA,i);
for(i=limit;i>=0;i--)
{
RSIBuffer[i]= RSIBuffer1[i];
marsioma[i] = iMAOnArray(RSIBuffer1,0,Ma_RSIOMA,0,Ma_RSIOMA_MODE,i);
//
//
//
}
//
//
//
for (i=0;i<indicator_buffers;i++) SetIndexDrawBegin(i,Bars-BarsToCount);
return(0);
}
//+------------------------------------------------------------------+
Comments