Ultitimate Oscillator_v1
Download scriptThis tool is designed to provide traders with a visual representation of market momentum by smoothing out price fluctuations. Instead of looking at raw, volatile price movements, it calculates a specialized composite value based on the asset's closing prices over different time horizons.
How the Logic Works
The core functionality of this script relies on three distinct layers of "Linear Weighted Moving Averages." In simple terms, a moving average is a tool that helps identify the general direction of a trend by averaging prices over a specific number of periods. By using a "weighted" version, the script gives more importance to recent price action while still accounting for historical data.
The indicator performs the following sequence of actions:
- Multi-Layer Analysis: The script simultaneously tracks three different timeframes: short-term (7 periods), medium-term (14 periods), and longer-term (28 periods).
- Data Aggregation: It calculates the average price for each of these three timeframes individually.
- Combined Output: It then adds these three averages together to produce a single, unified value. This combined value is what appears on your trading chart as a continuous line.
Purpose and Behavior
By combining these three different speeds of market data into one line, the indicator aims to filter out "market noise"—those small, rapid price zig-zags that can often mislead traders.
Because it pulls from multiple timeframes at once, the resulting line provides a more holistic view of where the price is heading. It allows you to see the underlying strength of a trend by synthesizing immediate price reactions with broader market movements. The result is a smoother visual guide intended to help identify the prevailing direction of the market more clearly than raw price action alone.
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+------------------------------------------------------------------+
//| Ultitimate Oscillator.mq4
//| Ramdass - Conversion only
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Green
extern int CountBars=300;
//---- buffers
double WUO[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- indicator line
IndicatorBuffers(1);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,WUO);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Ultitimate Oscillator |
//+------------------------------------------------------------------+
int start()
{
if (CountBars>=Bars) CountBars=Bars;
SetIndexDrawBegin(0,Bars-CountBars+28+1);
int i,counted_bars=IndicatorCounted();
//----
if(Bars<=28) return(0);
//---- initial zero
if(counted_bars<28)
{
for(i=1;i<=28;i++) WUO[CountBars-i]=0.0;
}
//----
i=CountBars-28-1;
while(i>=0)
{
WUO[i]=(iMA(NULL,0,7,0,MODE_LWMA,MODE_CLOSE,i)+
iMA(NULL,0,14,0,MODE_LWMA,MODE_CLOSE,i)+
iMA(NULL,0,28,0,MODE_LWMA,MODE_CLOSE,i));
i--;
}
return(0);
}
//+------------------------------------------------------------------+
Comments