OS Gaussian MA

Download script
Author: mladen
OS Gaussian MA

This tool is designed to provide traders with a smoothed visualization of market price action, specifically focusing on identifying potential support and resistance levels through a specialized mathematical lens.

Core Functionality

The primary objective of this script is to filter out the "noise" inherent in standard financial charts. Instead of showing every minor fluctuation of the market, it applies a Gaussian smoothing technique. In non-technical terms, this means the indicator calculates a weighted average of price movements, where data points closer to the present moment have a significant influence, while older data is gradually phased out. This results in a curve that is much more fluid and less jagged than a standard moving average.

Key Components

  • Customizable Price Source: The user can choose which specific type of price data the indicator should analyze. You can set it to follow the "Closing" price, the "Opening" price, the "High" or "Low" of a candle, or other averages like the Median or Weighted prices. This allows the tool to be tailored to different trading styles—for example, focusing on high-intensity price action versus steady closing trends.
  • Smoothing Sensitivity: The script includes a dedicated parameter to control the level of smoothing. By adjusting this value, you can decide how "tight" or "loose" the indicator follows the price. A lower setting will react more quickly to new price movements, while a higher setting provides a broader, more stable view of the market trend.
  • Visual Representation: The result is displayed directly on your trading chart as a distinct red line. Because it utilizes a Gaussian approach, the line acts as a dynamic guide, helping you identify where price has historically paused or reversed (support and resistance) without being distracted by erratic, short-term spikes.

How it Works in Practice

When the script runs, it constantly scans the historical data of your chosen timeframe. It performs its internal calculations to determine the "smoothed" value for every candle on your screen. By plotting this result as a continuous line, it helps you see the underlying momentum of the market more clearly, making it easier to spot significant shifts in direction or areas where the price is struggling to move forward.

9 Views
0 Downloads
0 Favorites
OS Gaussian MA
//+------------------------------------------------------------------+
//|                             One Side Gaussian Support Resistance |
//|                                                           mladen |
//+------------------------------------------------------------------+
#property copyright "mladen"
#property link      "mladenfxgmail.com"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1  Red
#property indicator_width1  2

//
//
//
//
//

extern int Price      = PRICE_CLOSE;
extern int SmoothType = 5;

//
//
//
//
//

double Average[];

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+

#import "OneSideGaussianLibrary.ex4"
   void   BuffersInit();
   double Smooth(int version,int price,int i);
#import

//
//
//
//
//

int init()
{
   BuffersInit();
   SetIndexBuffer(0, Average);
   
   string PriceType;
   switch(Price)
   {
      case PRICE_CLOSE:    PriceType = "Close";    break;  // 0
      case PRICE_OPEN:     PriceType = "Open";     break;  // 1
      case PRICE_HIGH:     PriceType = "High";     break;  // 2
      case PRICE_LOW:      PriceType = "Low";      break;  // 3
      case PRICE_MEDIAN:   PriceType = "Median";   break;  // 4
      case PRICE_TYPICAL:  PriceType = "Typical";  break;  // 5
      case PRICE_WEIGHTED: PriceType = "Weighted"; break;  // 6
   }      
   SmoothType  = MathMax(MathMin(SmoothType,7),0);
   IndicatorShortName("One side Gaussian MA ("+PriceType+","+SmoothType+")");
   return(0);
}

//
//
//
//
//

int start()
{
   int counted_bars = IndicatorCounted();
   int i,limit;

   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
           limit=Bars-counted_bars;
   
   //
   //
   //
   //
   //
   
   for(i = limit; i >= 0; i--) Average[i] = Smooth(SmoothType,Price, i);
   return(0);
}

Comments