RSIOMA_v2_006

Download script
Author: Copyright � 2007, MetaQuotes Software Corp.
RSIOMA_v2_006

This custom indicator is designed to provide a multi-layered analysis of market momentum by building upon the standard Relative Strength Index (RSI). Rather than simply looking at raw price action, it processes the data through several mathematical filters to identify trends, potential overbought/oversold conditions, and specific directional signals.

Core Logic and Data Processing

The indicator functions by transforming the price data into a smoothed momentum value. It begins by applying a Moving Average to the market price, which cleans up "noise" before calculating the RSI. This ensures that the resulting momentum line is smoother and less reactive to minor price fluctuations than a standard RSI.

Visual Signals and Components

The tool provides four distinct visual layers to help traders interpret the market:

  • Trend Identification: The indicator monitors the primary momentum level. When the value crosses specific thresholds (centered around the 50.00 mark), it uses color-coded highlights to indicate whether the current trend is leaning toward a long position or a short position.
  • Overbought and Oversold Tracking: The script specifically watches for extreme price conditions. It identifies "Support" signals when momentum drops into the lower zone (below 20) and begins to curve upward, suggesting a potential reversal from an oversold state. Conversely, it identifies "Resistance" signals in the upper zone (above 80) when momentum peaks and begins to turn downward, suggesting the market may be overextended.
  • Secondary Smoothing: To further refine the data, the indicator calculates a second moving average based on its own internal RSI values. This provides a secondary layer of trend confirmation, helping to distinguish between temporary price spikes and sustained movements.

Summary for Traders

Essentially, this script acts as a "filtered" momentum oscillator. Instead of just telling you if a price is high or low, it combines smoothed averages with specific logic gates to highlight three things:

  1. The direction of the prevailing trend.
  2. High-probability reversal zones (Support and Resistance).
  3. Confirmed momentum shifts based on moving average crossovers.
Indicators Used
Moving average indicatorRelative strength indexMoving average indicator
Miscellaneous
Implements a curve of type %1
15 Views
0 Downloads
0 Favorites
RSIOMA_v2_006
/*
   This indicator was created by Kalenzo
   email: bartlomiej.gorski@gmail.com
   web: http://www.fxservice.eu
   
   The base for this indicator was orginal RSI attached with Metatrader.
                                   ^^^^^ removed ^^^^^ :)|-<   
*/
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net/"

#property indicator_separate_window
#property indicator_minimum -10
#property indicator_maximum 110
#property indicator_level1 100
#property indicator_buffers 6
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 Green
#property indicator_color4 Magenta
#property indicator_color5 DodgerBlue
#property indicator_color6 BlueViolet

//---- input parameters
extern int RSIOMA          = 14;
extern int RSIOMA_MODE     = MODE_EMA;
extern int RSIOMA_PRICE    = PRICE_CLOSE;

extern int Ma_RSIOMA       = 21,
           Ma_RSIOMA_MODE  = MODE_EMA;

extern double BuyTrigger      = 80.00;
extern double SellTrigger     = 20.00;

extern color BuyTriggerColor  = DodgerBlue;
extern color SellTriggerColor = Magenta;

extern double MainTrendLong   = 50.00;
extern double MainTrendShort  = 50.00;

extern color MainTrendLongColor     = Red;
extern color MainTrendShortColor    = Green;

//---- buffers
double RSIBuffer[];
double MABuffer1[];

double bdn[],bup[];
double sdn[],sup[];

double marsioma[];
string short_name;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   short_name = StringConcatenate("RSIOMA(",RSIOMA,")");   
   IndicatorBuffers(7);
   
   SetIndexBuffer(0,RSIBuffer);
   SetIndexBuffer(2,bup);
   SetIndexBuffer(1,bdn);
   SetIndexBuffer(3,sdn);
   SetIndexBuffer(4,sup);
   SetIndexBuffer(5,marsioma);
   
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3);
   SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,1);
   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,1);
   SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,1);
   SetIndexStyle(4,DRAW_HISTOGRAM,STYLE_SOLID,1);
   SetIndexStyle(5,DRAW_LINE,STYLE_SOLID,1);
   
   SetIndexBuffer(6,MABuffer1);
         
   IndicatorShortName(short_name);

   SetIndexDrawBegin(0,RSIOMA);
   SetIndexDrawBegin(1,RSIOMA);
   SetIndexDrawBegin(2,RSIOMA);
   SetIndexDrawBegin(3,RSIOMA);
   SetIndexDrawBegin(4,RSIOMA);
   SetIndexDrawBegin(5,RSIOMA);
   SetIndexDrawBegin(6,RSIOMA);
   SetIndexDrawBegin(7,RSIOMA);
//----

   drawLine(BuyTrigger,"BuyTrigger", BuyTriggerColor);
   drawLine(SellTrigger,"SellTrigger", SellTriggerColor );
   drawLine(MainTrendLong,"MainTrendLong", MainTrendLongColor );
   drawLine(MainTrendShort,"MainTrendShort",MainTrendShortColor );

   return(0);
  }
//+------------------------------------------------------------------+
//| Relative Strength Index                                          |
//+------------------------------------------------------------------+
int start()
  {
   int   i, ii; 
   int   counted_bars=IndicatorCounted();
   double rel,negative,positive;
//----
   if(Bars<=RSIOMA) return(0);
//---- initial zero
   if(counted_bars<1)
      for(i=1;i<=RSIOMA;i++) {RSIBuffer[Bars-i]=0.0;}
//----
   ii=Bars-RSIOMA-1;
   if(counted_bars>=RSIOMA) ii=Bars-counted_bars-1;
   i = ii;
   while(i>=0)
      {  MABuffer1[i]=iMA(Symbol(),0,RSIOMA,0,RSIOMA_MODE,RSIOMA_PRICE,i);
      i--;  }
   i=ii;
   while(i>=0)           
      {  RSIBuffer[i]=iRSIOnArray(MABuffer1,0,RSIOMA,i);
      if(RSIBuffer[i] > MainTrendLong)                   bup[i] = -10;
      if(RSIBuffer[i] < MainTrendShort)                  bdn[i] = -10;
      if(RSIBuffer[i]<20 && RSIBuffer[i]>RSIBuffer[i+1]) sup[i] = -10;
      if(RSIBuffer[i]>80 && RSIBuffer[i]<RSIBuffer[i+1]) sdn[i] = -10;
      i--;  }
   i=ii;   
   while(i>=0)
      {  marsioma[i] = iMAOnArray(RSIBuffer,0,Ma_RSIOMA,0,Ma_RSIOMA_MODE,i); 
      i--;}
//----
return(0);
}
//+------------------------------------------------------------------+
void drawLine(double lvl,string name, color Col )
{
            ObjectDelete(name);
            ObjectCreate(name, OBJ_HLINE, WindowFind(short_name), Time[0], lvl,Time[0], lvl);
            ObjectSet(name, OBJPROP_STYLE, STYLE_DOT);
            ObjectSet(name, OBJPROP_COLOR, Col);        
            ObjectSet(name,OBJPROP_WIDTH,1);
}

Comments