WPO – Wave Period Oscillator
A Time Cycle Oscillator – Published on IFTA Journal 2018 by Akram El Sherbini (pages 68-77)
(http:www.ftaa.org.hk/Files/2018130101754DGQ1JB2OUG.pdf)
Bullish signals are generated when WPO crosses over 0
Bearish signals are generated when WPO crosses under 0
As with most oscillators, divergences can be taken advantage of.
DEFPARAM CalculateOnLastBars = 1000
//EmaPeriod = 14 //Number of Periods of the EMA
EmaPeriods = max(2,min(999,EmaPeriods)) //range 2-999
//
EmaPeriods = 14
Cy = close[1]
A = high
sinwt = close / A
sinsq = sinwt * sinwt
cossq = 1 - sinsq
coswt = sqrt(cossq)
Angle = atan(sinwt / coswt)
Rad = 3.14 * Angle / 180
Tt = 6.28 / Rad
if close>Cy then
Ti=Tt
else
Ti=-Tt
endif
WPO = average[EmaPeriods,1](Ti)
RETURN WPO AS "Wpo",0 AS "0",2.7 AS "ExtremeOB",2.0 AS "Ob",-2.0 AS "Os",-2.7 AS "ExtremeOS"
I just discovered that ProOrder (for automated strategies) does not evaluate the expression in line 15 correctly (as Probuilder does), so if you want to embed the code in your strategy you need to replace that line with: //Ti = ((close > Cy) * Tt) OR (((close Cy) THEN Ti = Tt ELSE Ti = -Tt ENDIF