mt4_PF_RSL_60m

Download script
mt4_PF_RSL_60m

This tool is designed to help traders analyze market trends by comparing current price action against historical averages across different timeframes. Specifically, it calculates a customized Relative Strength Line (RSL) that bridges the gap between what is happening on your current chart and the broader hourly market movement.

Core Logic and Functionality

The primary goal of this script is to provide a visual representation of whether the current price is overextended or undervalued relative to its recent history. Here is how the logic flows:

1. Data Collection and Smoothing The tool looks at a specific window of historical data, which you can customize (set by the "Aver_Bars" parameter). By default, it gathers information from 26 previous candles. Instead of looking at just one moment in time, it calculates an average price point over this entire period to establish a "baseline."

2. Multi-Timeframe Analysis One of the unique features of this script is its ability to look beyond your current screen. Even if you are viewing a small timeframe (like 1-minute or 5-minute charts), the script specifically pulls data from the 1-Hour (H1) timeframe. This allows a trader to see how the current price movement sits within the context of the larger, more significant hourly trend.

3. The Calculation Process The script performs a specific mathematical comparison:

  • It identifies the closing price of the most recent hour.
  • It compares that closing price against the average closing prices of the preceding 26 hours.
  • It then calculates the ratio between these two figures.

4. Visual Output The result of this calculation is plotted as a solid orange line in a separate window. This line acts as a guide for identifying momentum:

  • When the line moves significantly, it indicates how aggressively the price is deviating from its hourly average.
  • It helps filter out "noise" by focusing on the 1-hour trend, making it easier to spot whether the current price is gaining strength or losing steam compared to the broader market context.

Summary for the User

Essentially, this tool tells you: "Based on what has happened over the last 26 hours, where does the current price stand?" It provides a smoothed, multi-timeframe perspective that helps you stay aligned with the bigger picture while trading on smaller intervals.

Price Data Components
Series array that contains close prices for each bar
3 Views
0 Downloads
0 Favorites
mt4_PF_RSL_60m
//--------------------------------------------------------------------
// RSL 60M
// Multi Timeframe RSL Tests
//--------------------------------------------------------------------
#property indicator_separate_window    // Indicator is drawn in the main window
#property indicator_buffers 2         // Number of buffers
#property indicator_color2 Orange      // Buf_1 RSL Indikator


extern int Aver_Bars=26;               // number of bars for calculation

 
double Buf_1[];             // Declaring indicator arrays

//--------------------------------------------------------------------
int init()                          // Special function init()
  {
//--------------------------------------------------------------------
   SetIndexBuffer(1,Buf_1);         // Assigning an array to a buffer
   SetIndexStyle (1,DRAW_LINE,STYLE_SOLID,1);// Line style
//--------------------------------------------------------------------

  }

int start()
  {
   int i,counted_bars=IndicatorCounted(),n=0;
   double RSL_GD=0;

//----
   if(Bars<=Aver_Bars) return(0);
//---- initial zero
   if(counted_bars<1)
      for(i=1;i<=Aver_Bars;i++) Buf_1[Bars-i]=0.0;
//----
   i=Bars-Aver_Bars-1;
   if(counted_bars>=Aver_Bars) i=Bars-counted_bars-1;
   while(i>=0)
     {
      RSL_GD=0;
      
      
      for(n=0;n<Aver_Bars;n++)
         {
         RSL_GD=(RSL_GD+(iClose(Symbol(),PERIOD_H1,(i+n))));
         }
         

 
 //RSL zeichnen-START-------------------------------------------------------------   
      Buf_1[i]=(iClose(Symbol(),PERIOD_H1,i)/((RSL_GD)/Aver_Bars));
 //-------------------------------------------------------------------------------  


          i--;
     }
   return(0);
  }
//+------------------------------------------------------------------+

Comments