Karobein Oscillator [TradingView]
mrtools and kvak, here is
an interesting oscillator I found on TradingView that might be worth a port into MT4.
Here is the description of the indicator below, although I could not find any information about its creator when I did a search on Google:
Developed by Emily Karobein, the Karobein oscillator is an oscillator that aim to rescale smoothed values with more reactivity in a range of (0,1)
Calculation
The scaling method is similar to the one used in a kalman filter for the kalman gain.
We first average the up/downs x, those calculations are similar to the ones used for calculating the average gain/loss in the relative strength index.
a = ema(src < src ? x : 0,length)
b = ema(src > src ? x : 0,length)
where src is a exponential moving average of length period and x is src/src in the standard calculations, but anything else can be used as long as x > 0.
Then we rescale the results.
c = x/(x + b)
d = 2*(x/(x + c*a)) - 1
How To Use
It is better to use centerline-cross/breakouts/signal line.
In general when we use something smooth as input in oscillators, breakouts are better than reversals, you can see this with the stochastic and rsi.
So a simple approach could be buying when crossing over 0.8 and selling when crossing under 0.2.
Here is the balance of a strategy using those conditions, length = 50.
This is the code, clocking in at 14 lines:
Code: Select all
/@version=2
study("Karobein Oscillator")
length = input(50)
//
source = input(close)
src = ema(source,length)
a = ema(src < src[1] ? src/src[1] : 0,length)
b = ema(src > src[1] ? src/src[1] : 0,length)
c = (src/src[1])/(src/src[1] + b)
d = 2*((src/src[1])/(src/src[1] + c*a)) - 1
//
plot(d,color=orange,transp=0)
hline(0.8)
hline(0.2)
If somebody takes this on, I would only have two additional modifications to suggest:
1) Allow the use of multiple moving average types, since this indicator by default is based around the EMA.
2) Allow users to set the overbought and oversold lines in the "Inputs".
A thank you as always to all of the coders on this forum who tirelessly work to have these requests fulfilled!