The Smooth Price Oscillator (SPO) is a technical indicator designed to smooth and normalize price variations within a defined range. Unlike traditional oscillators, the SPO applies advanced smoothing and standard deviation techniques to provide clearer signals, less prone to market noise.
The primary goal of the SPO is to help traders identify reversal points and confirm trends with greater precision. This makes it an ideal tool for those seeking a balance between sensitivity and reliability in their chart analysis.
The SPO combines two smoothed price lines: one long and one short. These lines are derived from mathematical techniques based on exponential smoothing to eliminate market noise. The difference between these lines generates the central oscillator.
One of the most notable features of the SPO is the normalization of the oscillator using its standard deviation, along with the inclusion of deviation bands. This simplifies visual interpretation by providing dynamic upper and lower bounds.
In summary, the SPO is based on:
The calculation of the Smooth Price Oscillator is done in several steps:
The SPO provides several ways to interpret data and make trading decisions:
The oscillator colors provide intuitive visual guidance:
The SPO allows adjustment of several parameters to suit different trading styles and markets:
lenSmooth): Controls the smoothing period for the long and short lines.threshold): Defines the key overbought or oversold levels for generating signals.lenStd): Determines the period used to calculate the oscillator’s standard deviation.Configuration Tips:
lenSmooth to capture quick movements.lenSmooth to avoid false signals.threshold to match the volatility of the asset being analyzed.The Smooth Price Oscillator is a versatile tool that balances sensitivity and reliability in technical analysis. Its ability to filter market noise and provide clear signals makes it ideal for both novice and experienced traders.
Advantages:
Limitations:
The SPO is particularly useful in trending markets or assets with predictable movements, offering clear and visually appealing signals for more efficient decision-making.
//-------------------------------------------------//
//PRC Smooth Price Oscillator
//version = 0
//26.11.2024
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
//-------------------------------------------------//
// inputs
//-------------------------------------------------//
lenSmooth=20
threshold=1
lenStd=50
pi=3.1416
//-------------------------------------------------//
// Smoothed Line Long Calculation
//-------------------------------------------------//
periodL=2*Lensmooth
stepL=2*pi/periodL
a1L=exp(-sqrt(2)*pi/periodL)
b1L=2*a1L*cos((sqrt(2)*stepL/periodL)*180/pi)
c2L=b1L
c3L=-a1L*a1L
c1L=1-c2L-c3L
if barindex<4 then
LineLong=close
else
LineLong=c1L*(close+close[1])/2+c2L*LineLong[1]+c3L*LineLong[2]
endif
//-------------------------------------------------//
// Smoothed Line Short Calculation
//-------------------------------------------------//
periodS=Lensmooth
stepS=2*pi/periodS
a1S=exp(-sqrt(2)*pi/periodS)
b1S=2*a1S*cos((sqrt(2)*stepL/periodS)*180/pi)
c2S=b1S
c3S=-a1S*a1S
c1S=1-c2S-c3S
if barindex<4 then
LineShort=close
else
LineShort=c1S*(close+close[1])/2+c2S*LineShort[1]+c3S*LineShort[2]
endif
//-------------------------------------------------//
// Oscillator Calculation
//-------------------------------------------------//
oscillator = LineShort-LineLong
//-------------------------------------------------//
// Standard deviation for the Oscillator
//-------------------------------------------------//
stdevOsc=std[lenStd](oscillator)
//-------------------------------------------------//
// normalize the Oscillator
//-------------------------------------------------//
MaxstdevOsc=highest[lenStd](stdevOsc)
normalizedOsc=hullaverage[30](oscillator/MaxstdevOsc)
if normalizedOsc> 0 then
r=0
g=188
b=212
else
r=255
g=152
b=0
endif
if barindex>2*lenStd+31 then
colorbetween(normalizedOsc,0,r,g,b,100)
endif
//-------------------------------------------------//
// Bands for the oscillator
//-------------------------------------------------//
basis=average[250,1](normalizedOsc)
deviation=2*std[250](normalizedOsc)
upperband=basis+deviation
lowerband=basis-deviation
//-------------------------------------------------//
// Signals
//-------------------------------------------------//
signalup=normalizedOsc<-threshold and normalizedOsc>normalizedOsc[1] and normalizedOsc[1]<normalizedOsc[2]
signaldown=normalizedOsc>threshold and normalizedOsc<normalizedOsc[1] and normalizedOsc[1]>normalizedOsc[2]
if signalup then
drawpoint(barindex,normalizedOsc,2)coloured("aqua")
elsif signaldown then
drawpoint(barindex,normalizedOsc,2)coloured("orange")
endif
//-------------------------------------------------//
return normalizedOsc as "Normalized Oscillator" coloured("darkblue")style(line,2),upperband as "UpperBand" coloured("grey"),lowerband as "LowerBand" coloured("grey"), threshold as "+Treshold"coloured("GREY"),-threshold as "-Treshold"coloured("GREY")