rsier1m_v1
Download scriptThis script is designed as a visual trading tool for the MetaTrader platform, specifically built to identify potential trend reversals by monitoring price momentum. It functions by analyzing the Relative Strength Index (RSI)—a common technical indicator used to determine whether an asset is being overbought or oversold—across specific timeframes.
Core Logic and Functionality
The script operates by scanning historical price data to detect "crossover" points where the momentum of a currency pair or asset shifts significantly. Here is a breakdown of how the logic works:
1. Data Monitoring The tool looks at two distinct values of the RSI indicator: the current value and the previous value. It does this over a user-defined period (defaulting to 14) and on a specific timeframe (defaulting to 15 minutes). By comparing these two points, the script can see if momentum is increasing or decreasing.
2. Identifying Oversold Conditions (Buy Signals) The logic monitors for a specific "upward" shift in momentum. If the RSI was at or below the 30.00 mark in the previous bar and has moved above it in the current bar, the script interprets this as a potential sign that the asset was oversold and is starting to regain strength. When this occurs, the script places a light blue arrow below the price candle.
3. Identifying Overbought Conditions (Sell Signals) Conversely, the script monitors for a "downward" shift in momentum. If the RSI was at or above the 70.00 mark in the previous bar and has dropped back down to that level or lower in the current bar, it interprets this as a sign that the asset was overbought and is beginning to lose steam. When this happens, the script places a red arrow above the price candle.
4. Visual Representation Rather than providing a continuous line, this script acts as a signaling device. It cleans up the chart by only displaying arrows at the exact moments these momentum shifts are detected, allowing traders to quickly identify areas where the price might be reacting to extreme market conditions.
Summary of Usage
In short, this tool automates the process of watching for RSI levels hitting "extreme" zones (30 and 70). It alerts the user visually when the asset moves out of these zones, suggesting that a reversal in the current trend may be taking place.
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+------------------------------------------------------------------+
//| ADX Crossing.mq4
//| Amir
//+------------------------------------------------------------------+
#property copyright "Author - Amir"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 LightBlue
#property indicator_color2 Red
//---- input parameters
extern int Timeframe_in_Minutes=15;
extern int RSIperiod=14;
extern int CountBars=900;
//---- buffers
double val1[];
double val2[];
double rsib4,rsinow;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- indicator line
IndicatorBuffers(2);
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,108);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,108);
SetIndexBuffer(0,val1);
SetIndexBuffer(1,val2);
//----
return(0);
}
//+------------------------------------------------------------------+
//| AltrTrend_Signal_v2_2 |
//+------------------------------------------------------------------+
int start()
{
if (CountBars>=500) CountBars=Bars;
SetIndexDrawBegin(0,Bars-CountBars);
SetIndexDrawBegin(1,Bars-CountBars);
int i,shift,counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- initial zero
if(counted_bars<1)
{
for(i=1;i<=CountBars;i++) val1[CountBars-i]=0.0;
for(i=1;i<=CountBars;i++) val2[CountBars-i]=0.0;
}
for (shift = CountBars; shift>=0; shift--)
{
rsib4=iCustom(NULL,0,"#MTF_RSI",Timeframe_in_Minutes,RSIperiod,0,shift+1) ;
rsinow=iCustom(NULL,0,"#MTF_RSI",Timeframe_in_Minutes,RSIperiod,0,shift);
Comment (rsib4," ",rsinow);
val1[shift]=0;
val2[shift]=0;
if (rsinow>=30.00 && rsib4<= 30.00)
{
val1[shift]=Low[shift]-5*Point;
}
if (rsib4>=70.00 && rsinow<=70.00)
{
val2[shift]=High[shift]+5*Point;
}
}
return(0);
}
//+------------------------------------------------------------------+
Comments