Accrete-MFBtm_DZRSI
Download scriptThis tool is designed to provide a sophisticated visual analysis of market momentum by transforming standard price movement data into a more readable, multi-layered indicator. Rather than looking at raw prices, it focuses on the "Relative Strength Index" (RSI)—a common metric used to determine whether an asset is overbought or oversold—and applies several layers of mathematical refinement to identify high-probability trading zones.
Momentum Tracking
At its core, the script calculates the RSI to track the velocity and strength of price movements. To make this data more actionable, it overlays a "Signal Moving Average." This smooths out the erratic spikes often found in raw momentum data, allowing you to see the underlying trend of the market's strength more clearly.
Dynamic Volatility Bands
The primary innovation of this script is the creation of dynamic zones. Instead of using static lines that don't adapt to changing market conditions, it calculates a moving average of the RSI and then builds "Bands" around it based on the market's current volatility (Standard Deviation).
It uses specific mathematical proportions (Fibonacci-inspired ratios) to establish three distinct types of boundaries:
- Outer Zones: These represent extreme momentum shifts. They identify when the market is stretching significantly in one direction, potentially signaling a point of exhaustion.
- Inner Zones: These act as secondary boundaries, providing a tighter look at the "normal" range of price action and helping to filter out minor noise.
Statistical Foundation
To ensure these bands are accurate, the script performs real-time statistical calculations. It measures the variance of the data over a specific period to determine how much the market is "swinging." By calculating the Standard Deviation, the tool automatically expands the bands during periods of high turbulence and tightens them during calmer markets.
Summary of Visual Output
For the user, this means the chart provides a clear visual map of market behavior:
- Trend Identification: The moving averages show you the general direction of momentum.
- Volatility Mapping: The dynamic bands show you the "expected" range of price movement based on current volatility.
- Breakout Awareness: When the RSI moves outside of these dynamically calculated zones, it provides a technical signal that the market is reacting with unusual strength or weakness, highlighting potential entry or exit opportunities.
/*+~><>~~~~~~~~~~~~~~~~~~~~~~><>~~~~~~~~~~~~~~~~~~~~~~><>~~~~~~~~~~~~~~~~~~~~~~+
| |
| Copyright © 2006, Accrete LLC |
| http://www.accrete.com |
| For further information on the Accrete - MultipleFiboBands Trading Model", |
| visit the web at www.accrete.com/fx-atm . There you will find various |
| links, trade examples, and the latest updates on the model by Accrete |
+~><>~~~~~~~~~~~~~~~~~~~~~~><>~~~~~~~~~~~~~~~~~~~~~~><>~~~~~~~~~~~~~~~~~~~~~~+
*/
// property copyright "Original Dynamic Zone RSI Copyright © 2005, Pavel Kulko polk@alba.dp.ua"
#property copyright "Accrete LLC"
#property link "www.accrete.com"
#property indicator_buffers 7
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_color3 Blue
#property indicator_color4 Red
#property indicator_color5 Blue
#property indicator_color6 Lime
#property indicator_color7 Yellow
#property indicator_separate_window
extern int RSIPeriod = 8;
extern int SignalMA_Period=8;
extern int SignalMA_Method=0; //0=sma,1=ema,2=smma,3=lwma
extern int BandPeriod = 20;
double RSIBuf[],UpZone[],DnZone[],UpZonei[],DnZonei[],RSIBufdot[],SignalMABuf[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
int draw_begin;
string short_name;
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,RSIBuf);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,UpZone);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,DnZone);
SetIndexStyle(3,DRAW_LINE,2,1);
SetIndexBuffer(3,UpZonei);
SetIndexStyle(4,DRAW_LINE,2,1);
SetIndexBuffer(4,DnZonei);
SetIndexStyle(5,DRAW_ARROW, EMPTY);
SetIndexArrow(5,115);
SetIndexBuffer(5,RSIBufdot);
SetIndexStyle(6,DRAW_LINE,2,1);
SetIndexBuffer(6,SignalMABuf);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
double MA, RSI[];
ArrayResize(RSI,BandPeriod);
int counted_bars=IndicatorCounted();
int limit = Bars-counted_bars-1;
for(int i=limit; i>=0; i--)
{
RSIBuf[i] = iRSI(NULL,0,RSIPeriod,MODE_CLOSE,i);
MA = 0;
for(int j=i; j<i+BandPeriod; j++) {
RSI[j-i] = RSIBuf[j];
MA += RSIBuf[j]/BandPeriod;
}
{
RSIBufdot[i] = iRSI(NULL,0,RSIPeriod,MODE_CLOSE,i);
}
UpZone[i] = MA + (1.382 * StDev(RSI,BandPeriod));
DnZone[i] = MA - (1.382 * StDev(RSI,BandPeriod));
UpZonei[i] = MA + (0.382 * StDev(RSI,BandPeriod));
DnZonei[i] = MA - (0.382 * StDev(RSI,BandPeriod));
}
for(i=limit; i>=0; i--)
{
SignalMABuf[i]=iMAOnArray(RSIBuf,0,SignalMA_Period,0,SignalMA_Method,i);
// SignalMABuf[i]=iMAOnArray(RSIBuf,0,SignalMA_Period,0,MODE_LWMA,i);
}
//----
return(0);
}
double StDev(double& Data[], int Per)
{
return(MathSqrt(Variance(Data,Per)));
}
double Variance(double& Data[], int Per)
{
double sum, ssum;
for (int i=0; i<Per; i++)
{
sum += Data[i];
ssum += MathPow(Data[i],2);
}
return((ssum*Per - sum*sum)/(Per*(Per-1)));
}
//+------------------------------------------------------------------+
Comments