Overview
The SmoothCandle S is a specialized technical analysis tool designed to filter out market "noise" by creating a stabilized view of price action. While standard price charts can be volatile with rapid fluctuations, this indicator focuses on identifying underlying trends by smoothing the core components of every candlestick.
How it Works
Instead of simply showing you the raw price at any given moment, the script calculates four distinct averages based on your chosen look-back period (the SMA setting). It treats each element of a standard candle—the Opening price, the High, the Low, and the Closing price—as individual data points to be averaged.
Specifically, the logic performs the following steps:
- Data Aggregation: The tool looks back at a specific number of previous candles (defined by the SMA parameter).
- Component Averaging: It calculates the average for each specific part of the candle over that period. For example, it finds the average "High" reached over the last few bars, as well as the average "Open," "Low," and "Close."
- Trend Stabilization: By plotting these four smoothed averages simultaneously, the indicator provides a clearer picture of where the price is moving relative to its recent history.
Key Features for Traders
- Noise Reduction: By smoothing the highs and lows, it helps traders ignore minor price spikes that might otherwise trigger false signals.
- Visual Clarity: The tool visualizes the "heart" of the price movement, making it easier to see the progression of a trend without the distraction of erratic, short-term fluctuations.
- Customizable Sensitivity: Users can adjust the SMA period to determine how much historical data should influence the smoothing effect, allowing for a balance between responsiveness to new moves and the stability of long-term trends.
Summary
In essence, SmoothCandle S acts as a visual stabilizer. It takes the chaotic movements of live price action and translates them into a smoother, more manageable flow of data, helping traders identify the true direction of the market with greater confidence.
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+------------------------------------------------------------------+
//| SmoothCandle S v1.00.mq4 |
//| Copyright © 2005, Varus Henschke |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Varus Henschke"
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 DimGray
#property indicator_color3 DimGray
#property indicator_color4 Blue
//---- indicator parameters
extern int SMA=5;
//---- indicator buffers
double nOpen[];
double nHigh[];
double nLow[];
double nClose[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicator line
IndicatorBuffers(4);
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexStyle(2,DRAW_LINE);
SetIndexStyle(3,DRAW_LINE);
//---- line shifts when drawing
SetIndexShift(0,SMA);
SetIndexShift(1,SMA);
SetIndexShift(2,SMA);
SetIndexShift(3,SMA);
//---- indicator buffers mapping
if(!SetIndexBuffer(0,nOpen) && !SetIndexBuffer(1,nHigh) && !SetIndexBuffer(2,nLow) && !SetIndexBuffer(3,nClose))
Print("cannot set indicator buffers!");
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("SmoothCandle S SMA ( "+SMA+" )");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Moving Averages of Candlestick |
//+------------------------------------------------------------------+
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-SMA-1;
for(int i=SMA; i<limit; i++){ // Does not work if i=0 so included SetIndexShift above. That does my head in.
nOpen[i] = 0;
nHigh[i] = 0;
nLow[i] = 0;
nClose[i] = 0;
for(int j=i-SMA; j<i; j++){
nOpen[i] = nOpen[i] + (Open[j] / SMA);
nHigh[i] = nHigh[i] + (High[j] / SMA);
nLow[i] = nLow[i] + (Low[j] / SMA);
nClose[i] = nClose[i] + (Close[j] / SMA);
}
}
//---- done
return(0);
}
Comments