robertogozzi

SHO - Simple Harmonic Oscillator

Category: Indicators By: robertogozzi Created: March 15, 2019, 10:35 AM
March 15, 2019, 10:35 AM
Indicators
4 Comments
SHO - Simple Harmonic Oscillator

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

  • OverBought level is 40
  • OverSold level is -40
  • ExtremeOB level is 60
  • ExtremeOS level is -60

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"

Download
Filename: SHO-Simple-Harmonic-Oscillator.txt
Downloads: 118
Download
Filename: SHO-Simple-Harmonic-Oscillator.itf
Downloads: 333
robertogozzi
robertogozzi Legend
Roberto https://www.ots-onlinetradingsoftware.com
Author’s Profile

Comments

robertogozzi
8 years ago
#

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

robertogozzi
8 years ago
#

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.

jcisneros
8 years ago
#

good job, its fine for divergences. Thank you

PastaPesto
8 years ago
#

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?

ProRealCode ProRealCode
Loading...