Nicolas

Sentiment Zone Oscillator

Category: Indicators By: Nicolas Created: February 13, 2016, 11:11 AM
February 13, 2016, 11:11 AM
Indicators
4 Comments
Sentiment Zone Oscillator

The Sentiment Zone Oscillator (SZO) was authored by Walid Khalil in the Stocks and Commodities Magazine, May 2012. The SZO uses a triple exponential moving average (TEMA) of a plus-minus value, triggered by the current and previous closing prices. Over-bought and over-sold paths and adjustable guides are also given.

This oscillator attempt to measure overall market sentiment and give overbought and oversold levels to play with. Bullish signal may occur when the oscillator is rising from the lower level and bearish one when the white line is quitting the higher level.

Overbought and oversold are dynamic, they take the higher and lower value that the oscillator had in the last  “SZOLongPeriod”.

 

// parameters
// SZOPeriod = 14
// SZOLongPeriod = 30
// PriceFiltering = 14
// SZOPercent = 95
// AveragePeriod = 14


if(barindex>SZOLongPeriod) then
  prices = average[PriceFiltering](close)

  if prices>prices[1] then
   useValues = 1
  else
   useValues = -1
  endif

  alpha = 2/(1+SZOPeriod)

  worktema1 = worktema1[1]+alpha*(UseValues-worktema1[1])
  worktema2 = worktema2[1]+alpha*(worktema1-worktema2[1])
  worktema3 = worktema3[1]+alpha*(worktema2-worktema3[1])
  mytema = worktema3+3.0*(worktema1-worktema2)

  result = 100*mytema

  szo = result/SZOPeriod

  hi=0
  lo=0

  for i = 0 to SZOLongPeriod do
   if szo[i]>hi then
     hi = szo[i]
   endif
   if szo[i]<lo then
     lo = szo[i]
  endif
  next

  rn = hi-lo

  upz = lo+rn*SZOPercent/100
  dnz = hi-rn*SZOPercent/100

  avg = exponentialaverage[AveragePeriod](szo)
endif

RETURN szo coloured(255,255,255) as "sentiment zone oscillator", avg coloured(50,205,50) as "average", upz coloured(50,205,50) as "up channel", dnz coloured(219,112,247) as "down channel"

 

Download
Filename: Sentiment-Zone-Oscillator.itf
Downloads: 160
Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

hq76
11 years ago
#

hello, i have tried your indicator and it looks good. It's filtering a lot but it gave good results in the past i guess.

Nicolas
11 years ago
#

Thanks for commenting. Well, it is not "my" indicator, it is one I have adapted from other trading programming language. If you find it useful, you should post your suggestions about how to use it, here in the comments area or in the forums.

hq76
11 years ago
#

OK I will do it. Are there any possibilities to transform other indicators please?

Nicolas
11 years ago
#

Yes it is possible, as long as it is possible to have the same functionalities. You can post your request in the Programming Support forum section.

ProRealCode ProRealCode
Loading...