ColorRSI1
Download scriptThe ColorRSI indicator is designed to provide traders with a clear, visual representation of market momentum by adding a dynamic color-coding system to the standard Relative Strength Index (RSI). While a traditional RSI shows you the strength of price movements as a single line, this tool helps you distinguish between "bullish" and "bearish" territory at a glance.
How It Works
The core logic of this script revolves around monitoring the RSI value—a common technical indicator that measures the speed and change of price movements. The indicator continuously tracks the RSI based on the specific timeframe and price settings you choose.
The primary innovation in this script is its binary color switching logic:
- Bullish Momentum (Green): When the RSI value rises above the middle threshold of 50, the script identifies the market as having upward momentum. It visually represents this by highlighting the data points in green.
- Bearish Momentum (Red): When the RSI value drops below the 50 threshold, the script identifies downward momentum and switches the visual representation to red.
Key Benefits for Traders
By separating the data into two distinct visual paths based on the 50-level mark, this indicator eliminates the "visual noise" of a single overlapping line. It allows you to:
- Identify Trend Shifts Instantly: You can see exactly when the market sentiment flips from one side to the other without having to constantly squint at specific numbers.
- Clarify Market Sentiment: The clear distinction between red and green zones provides an immediate psychological cue regarding whether the current price action is trending toward the upper or lower boundaries of the RSI scale.
- Maintain Historical Context: The script processes a large amount of historical data (up to 1,000 bars by default), allowing you to look back at past trends to see how often the momentum shifted during specific market cycles.
In summary, this tool takes the standard RSI logic and translates it into a high-contrast visual map, making it easier for traders to recognize trend changes and react more quickly to shifting market dynamics.
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+------------------------------------------------------------------+
//| ColorRSI.mq4 |
//| Copyright © 2006 , David W Honeywell , 12/12/2006 |
//| HellOnWheels.Trans@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006 , David W Honeywell , 12/12/2006"
#property link "HellOnWheels.Trans@gmail.com"
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_maximum 100.0
#property indicator_minimum 0.0
#property indicator_level1 70
#property indicator_level2 50
#property indicator_level3 30
extern int IndicatorTime = 0;
extern int RSI_Periods = 3;
extern int Applied_Price = 0;
extern int LineWidth = 4;
extern int ShowBars = 1000;
double Buffer0[];
double Buffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,LineWidth);
SetIndexBuffer(0,Buffer0);
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,LineWidth);
SetIndexBuffer(1,Buffer1);
IndicatorShortName(" ColorRSI ( "+RSI_Periods+" )");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit=ShowBars;
//---- indicator calculation
for(int i=limit; i>=0; i--)
{
double RSIValue=iRSI(Symbol(),IndicatorTime,RSI_Periods,Applied_Price,i);
if (RSIValue > 50.00000000)
{
Buffer0[i] = RSIValue;
Buffer1[i] = EMPTY_VALUE;
if (Buffer0[i+1] == EMPTY_VALUE) Buffer0[i+1] = Buffer1[i+1];
}
else
{
Buffer0[i] = EMPTY_VALUE;
Buffer1[i] = RSIValue;
if (Buffer1[i+1] == EMPTY_VALUE) Buffer1[i+1] = Buffer0[i+1];
}
}
//---- done
return(0);
}
//+------------------------------------------------------------------+
Comments