Rads Wall-4
Download scriptThe 9Squared Wall is a technical analysis tool designed to help traders visualize market trends and potential momentum shifts by smoothing out price fluctuations. Instead of looking at the volatile "noise" of raw price candles, this script calculates four distinct moving averages that act as visual guides on your chart.
How It Works
The logic behind this indicator relies on tracking different types of price data—specifically the Opening price, Closing price, and Median price—across varying time horizons. By blending these inputs, the tool provides a clearer picture of where the market "weight" is shifting.
Here is a breakdown of the four components it tracks:
- Fast Trend Analysis: The script monitors two "fast" averages. One focuses on the Closing prices and the other on the Opening prices. Because these use shorter time periods, they react more quickly to recent market movements, helping you see immediate momentum.
- Slow Trend Analysis: The script simultaneously tracks two "slow" averages. These focus on the Median prices over much longer time horizons. These lines are designed to ignore temporary spikes and show you the broader, long-term direction of the market.
Visual Interpretation
The indicator renders these calculations as histograms on your chart. By comparing the relationship between the fast-moving components and the slow-moving components, traders can identify:
- Trend Strength: When the fast lines align with the slow lines, it suggests a strong, established trend.
- Potential Reversals: If the fast lines begin to deviate significantly from the slow lines, it may indicate that the current momentum is weakening or that a price reversal is approaching.
- Support and Resistance: The slower median averages act as "walls" or zones where price may face significant pressure, providing a structural map of the market's behavior.
In summary, this script filters out market distractions to give you a layered view of price action, combining immediate sentiment with long-term structural trends.
//+------------------------------------------------------------------+
//| 9Squared Wall.mq4 |
//| Copyright © 2007 Steve Bowley |
//| http://www.9squaredfx.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007 Steve Bowley"
#property link "http://www.9squaredfx.com"
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_color3 Black
#property indicator_color4 Black
//---- input parameters
extern int FastClosePeriod=27;
extern int FastCloseShift=0;
extern int FastOpenPeriod=34;
extern int FastOpenShift=0;
extern int SlowClosePeriod=34;
extern int SlowCloseShift=0;
extern int SlowOpenPeriod=62;
extern int SlowOpenShift=0;
//---- indicator buffers
double ExtBlueBuffer[];
double ExtRedBuffer[];
double ExtDarkVioletBuffer[];
double ExtBlackBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- line shifts when drawing
SetIndexShift(0,FastCloseShift);
SetIndexShift(1,FastOpenShift);
SetIndexShift(2,SlowCloseShift);
SetIndexShift(3,SlowOpenShift);
//---- first positions skipped when drawing
SetIndexDrawBegin(0,FastCloseShift+FastClosePeriod);
SetIndexDrawBegin(1,FastOpenShift+FastOpenPeriod);
SetIndexDrawBegin(2,SlowCloseShift+SlowClosePeriod);
SetIndexDrawBegin(3,SlowOpenShift+SlowOpenPeriod);
//---- 3 indicator buffers mapping
SetIndexBuffer(0,ExtBlueBuffer);
SetIndexBuffer(1,ExtRedBuffer);
SetIndexBuffer(2,ExtDarkVioletBuffer);
SetIndexBuffer(3,ExtBlackBuffer);
//---- drawing settings
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexStyle(2,DRAW_NONE,0,2);
SetIndexStyle(3,DRAW_NONE,0,2);
//---- index labels
SetIndexLabel(0,"FastClose");
SetIndexLabel(1,"FastOpen");
SetIndexLabel(2,"SlowClose");
SetIndexLabel(3,"SlowOpen");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| 9Squared Trader |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- main loop
for(int i=0; i<limit; i++)
{
//---- ma_shift set to 0 because SetIndexShift called abowe
ExtBlueBuffer[i]=iMA(NULL,0,FastClosePeriod,0,MODE_EMA,PRICE_CLOSE,i);
ExtRedBuffer[i]=iMA(NULL,0,FastOpenPeriod,0,MODE_EMA,PRICE_OPEN,i);
ExtDarkVioletBuffer[i]=iMA(NULL,0,SlowClosePeriod,0,MODE_EMA,PRICE_MEDIAN,i);
ExtBlackBuffer[i]=iMA(NULL,0,SlowOpenPeriod,0,MODE_EMA,PRICE_MEDIAN,i);
}
//---- done
return(0);
}
//+------------------------------------------------------------------+
Comments