Author: Yuriy Tokman
RSI_Tokman

This technical tool is designed to provide traders with a visual and audible signal regarding market momentum by analyzing price fluctuations. Instead of looking at raw price data alone, it processes information through two distinct layers of mathematical filtering to identify specific "turning points" in the market.

Core Operational Logic

The script functions by performing a three-step analysis of the market:

1. Momentum Calculation (RSI) First, the tool calculates a standard Relative Strength Index (RSI). This is a common momentum oscillator that measures the speed and change of price movements. It essentially helps determine whether an asset is being bought or sold aggressively.

2. Smoothing the Data (Moving Average) To prevent "noise" or erratic jumps from triggering false signals, the script does not look at the RSI directly. Instead, it applies a Moving Average to those RSI values. This smoothing process identifies the underlying trend of the momentum, making it easier to see the general direction of the market rather than minor price fluctuations.

3. Threshold Analysis and Signaling The final logic focuses on the 50-level midpoint of this smoothed data. The script is designed to detect when the momentum crosses this central line:

  • Bottom Crossings: When the value moves from below 50 to above 50, it suggests a shift toward upward momentum.
  • Top Crossings: When the value moves from above 50 to below 50, it suggests a shift toward downward momentum.

Visual and Audible Alerts

The tool translates these mathematical movements into practical information for the user:

  • Visual Indicators: It plots lines on a separate window in your trading platform, allowing you to see the smoothed momentum trend visually.
  • Color Coding: It uses specific colors (Lime and Red) to differentiate between price points relative to the threshold.
  • Audio Notifications: If enabled, the tool will trigger an immediate audible alert and a pop-up message on your screen the exact moment the momentum crosses the 50-level mark, notifying you of a potential change in market direction in real-time.
Indicators Used
Relative strength indexMoving average indicator
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screen
11 Views
0 Downloads
0 Favorites
RSI_Tokman
//+------------------------------------------------------------------+
//|                                                         OSMA.mq4 |
//|  10 íîÿáðÿ 2008ã.                                    Yuriy Tokman |
//| ICQ#:481-971-287                           yuriytokman@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Yuriy Tokman"
#property link      "yuriytokman@gmail.com"

#property indicator_separate_window

#property indicator_buffers 3

#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_level1 50
#property indicator_levelcolor       DarkBlue


extern int  period_RSI           = 14;
extern int  applied_price_RSI    = 0;
extern int  period_MA            = 5;
extern int  ma_method            = 3;
extern bool Sound                = true;      

double Buf0[];
double Buf1[];
double Buf2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
       SetIndexBuffer(0,Buf0);
       SetIndexBuffer(1,Buf1);
       SetIndexBuffer(2,Buf2);
       
       SetIndexStyle(0,DRAW_LINE,0,2);
       SetIndexStyle(1,DRAW_LINE,0,2);
       SetIndexStyle(2,DRAW_NONE);
       
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   for(int i=0; i<limit; i++)
    {
     Buf2[i]=iRSI(NULL,0,period_RSI,applied_price_RSI,i);
    }
     
   for(i=0; i<limit; i++)
    {
     double r = iMAOnArray(Buf2,0,period_MA,0,ma_method,i) ;
     double r1 = iMAOnArray(Buf2,0,period_MA,0,ma_method,i+1) ;
     if (r<53)  Buf1[i]=r ;
     if (r>47)  Buf0[i]=r ;
     if (Sound == true)
     {
      if(r>=50 && r1<=50) {Alert("Crossing in a bottom\n\" Indicators to order e-mail: yuriytokman@gmail.com \"\nRSI= ", r);}
      if(r<=50 && r1>=50) {Alert("Crossing in top\n\" Indicators to order ISQ#:481-971-287 \"\nRSI= ", r);}
     }
     
    } 
   return(0);
  }
//+------------------------------------------------------------------+

Comments