RSI-R2_voting_Ron4a
Download scriptThis tool is designed to help traders identify potential market trends by analyzing price momentum across multiple different timeframes simultaneously. Instead of relying on a single data point, it uses a "voting" system to gauge the overall strength of a move in the market.
How the Logic Works
1. Multi-Period Analysis The script looks at the Relative Strength Index (RSI)—a common momentum indicator—across various settings. It doesn't just look at one timeframe; it scans through a series of different "voting" periods (for example, checking 20 different variations) to see how they are behaving in relation to the Daily chart.
2. The "Voting" Mechanism For every point on your chart, the tool performs a deep scan:
- It checks each of those various timeframes to see if the RSI is currently moving in a specific direction.
- It looks for a specific sequence: Is the current momentum lower/higher than the previous period, and was that previous period also lower/higher than the one before it?
- If a timeframe meets this criteria, it casts a "vote" for either a Buy signal (downward momentum) or a Sell signal (upward momentum).
3. Signal Filtering To ensure the signals are significant, the tool only highlights trends that reach a certain level of consensus. You can set a "Vote Count" threshold; the script will only place a visual marker on your chart if the number of agreeing timeframes exceeds that specific number. This helps filter out "noise" and focuses on movements where many different timeframes agree on the trend.
4. Visual Representation When the market consensus meets your required criteria, the tool places a text label directly on your chart:
- White Labels: Indicate a high number of votes for a potential "Buy" opportunity (based on falling momentum).
- Red Labels: Indicate a high number of votes for a potential "Sell" opportunity (based on rising momentum).
- The number displayed on the label tells you exactly how many timeframes are currently in agreement with that move.
Summary for the User
In simple terms, this indicator acts like a committee of experts. Rather than asking one expert (one RSI) what the market is doing, it asks 20 different experts. If the majority of those experts agree that the price is gaining or losing strength significantly, the tool marks that spot on your chart so you can easily identify high-probability trend directions at a glance.
//+-----------------------------------+
//| RSI multi-period voting indicator |
//+-----------------------------------+
#property copyright "Ron Thompson"
#property link "http://www.ForexMT4.com/forex"
// This INDICATOR is NEVER to be SOLD individually
// This INDICATOR is NEVER to be INCLUDED as part of a collection that is SOLD
#property indicator_chart_window
#property indicator_buffers 6
//---- input parameters
extern int numvotes = 20;
extern int votecount = 0;
extern int Day1_Rsi_low = 65;
extern int Day1_Rsi_hi = 35;
extern bool ObjDelete = true;
int uniq=0;
int bartime;
//+------+
//| Init |
//+------+
int init()
{
}
//+------+
//|DeInit|
//+------+
int deinit()
{
if(ObjDelete)ObjectsDeleteAll();
}
//+------+
//|Start |
//+------+
int start()
{
int buy_vote;
int sell_vote;
int voting;
double RSI1=0;
double RSI2=0;
double RSI3=0;
// draw once at open of bar for all previous bars
if(bartime!=Time[0])
{
bartime=Time[0];
for (int i=Bars; i>=0; i--)
{
buy_vote=0;
sell_vote=0;
for(voting=numvotes+1; voting>=2; voting--)
{
RSI1 = iRSI(Symbol(), PERIOD_D1, voting, PRICE_OPEN, i+0);
RSI2 = iRSI(Symbol(), PERIOD_D1, voting, PRICE_OPEN, i+1);
RSI3 = iRSI(Symbol(), PERIOD_D1, voting, PRICE_OPEN, i+2);
if (RSI1 < Day1_Rsi_low && RSI2 < RSI1 && RSI3 < RSI2 )
{
buy_vote++;
}
if (RSI1 > Day1_Rsi_hi && RSI2 > RSI1 && RSI3 > RSI2 )
{
sell_vote++;
}
}//for voting
if ( buy_vote>votecount )
{
ObjectCreate("myx"+DoubleToStr(uniq,0), OBJ_TEXT, 0, Time[i], Open[i] );
ObjectSetText("myx"+DoubleToStr(uniq,0),DoubleToStr(buy_vote,0),15,"Arial",White);
uniq++;
}
if ( sell_vote>votecount )
{
ObjectCreate("myx"+DoubleToStr(uniq,0), OBJ_TEXT, 0, Time[i], Open[i] );
ObjectSetText("myx"+DoubleToStr(uniq,0),DoubleToStr(sell_vote,0),15,"Arial",Red);
uniq++;
}
}//for i
}//if bartime
}//start
Comments