SHO – Simple Harmonic Oscillator
A Time Cycle Oscillator – Published on IFTA Journal 2018 by Akram El Sherbini (pages 80-84)
(http://www.ftaa.org.hk/Files/2018130101754DGQ1JB2OUG.pdf)
Bullish signals are generated when SHO crosses over 0
Bearish signals are generated when SHO 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]
Vt = close - Cy
Vy = Vt[1]
Att = Vt - Vy
Ema = average[EmaPeriods,1](Att)
Tt = sqrt(abs(Vt/Ema))
Ti = ((close > Cy) * Tt) OR (((close <= Cy) * Tt) * -1)
Vp = average[EmaPeriods,1](Ti)
Tp = average[EmaPeriods,1](Tt)
Sho = Vp / Tp * 100
RETURN Sho AS "Sho",0 AS "0",60 AS "ExtremeOB",40 AS "Ob",-40 AS "Os",-60 AS "ExtremeOS"
You must be logged in to post a comment.
I just realized that there's a line that shouldn't be there. It's line 5, please remove it, since It overrides any setting you may want to change by either CALLing it or setting the indicator's properties. I think this is the cause. Sorry for any inconvenience.
Hello Roberto! Thank you for this indicator. I thought I would try it out in a strategy, but something goes wrong when I "call" it. I made a graph from the strategy and comparing it to the indicator and it shows some totally different numbers. I also inserted the whole code inside the strategy but I get the same result. Any idea what could be wrong?
I just discovered that ProOrder (for automated strategies) does not evaluate the expression in line 12 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