Hi Nicolas,
^ (1) Line 5, I missed that, I was expecting two equations for the high and low but of course it can be calculated as one. Thanks.
Kase Peak Oscillator:
(2) The way I read it was that the Kase PeakOscillator finds the most significant Highs and Lows for 50 separate look back lengths of time.
https://forum.mql4.com/39628
I think I have found a better explanation from Cynthia Kase herself: http://www.kaseco.com/support/articles/The_Two_Faces_of_Momentum.pdf
Page 5:
“The Kase indicators, rather than using a fixed number of periods, use a loop built into the code that chooses the best cycle length (more below). Also, when volatility increases, traditional indicators often overreact. Kase’s indicators account for changes in volatility and, thus, avoid such overreactions.”
“Both indicators (Kase Peak Oscillator and KaseCD and are based on the Kase Serial Dependency Index where:
ln(H[N-1]/L[0])/V is used for up moves and
ln(L[N-1]/H[0])/V for down moves, where:
H[N-1] = high n bars ago
H[0] = this barís high
L[N-1] = low n bars ago
L[0] = this barís low
V = historical volatility over n bars
N = a number from n1 to n2 that gives the
highest resultant value for the index. “
The KaseCD which is like the MACD and is the PeakOscillator minus its own average where the histogram equals
KCD histogram = PeakOscillator – average (PeakOscillator, n.
Re your question: “How would the code measure the length of a trend?”
http://www.kaseco.com/support/whitepapers/Kase%20StatWare.pdf
Page 3
“The Kase Serial Dependency Index, or KSDI: What the index does, when looking at “up” markets, is divide the natural logarithm (log to base e – an “existential” number) of the high n days ago to the low today, by the volatility, which is also logarithmically based. The opposite calculation is made for the “down” as shown below. Since volatility is a one standard deviation logarithmic rate of change, we can think of it as a standard of measurement for the market. The higher the ratio of the actual market movement to this measure, the more it is exhibiting serial dependency – or “trendiness”.
Should prices move to about two standard deviations, there is less than a 3% chance that the “trend” will continue and prices will then be expected to revert. (2 Std Deviations represents 95.4% of the data/values in a normal distribution. Out of 1000 occurrences, there is a 46 chance in 1000, or 4.6 chance in 100 that values will occur within two standard deviations. Only 3 values out of a 1,000 will fall outside of the area of 3 St Deviations).
Kase Serial Dependency Index
Volatility = stddev (ln(P/P[1])[n])
KSDI (up) = (ln(H[0]/L[n]))/volatility[n]
KSDI (down) = (ln(L[0]/H[n])/volatility[n]
There are two indicators that are derived from the KSDI, the PeakOscillator and the KaseCD. The Kase PeakOscillator is a sense parallels a simple oscillator which takes the difference between two moving averages. But, in the case of the PeakOscillator, the indicator takes the difference between the up and down indices.
The actual index value is based on an “n” where the number of periods in question, over a range of look back lengths (apparently meant to be 50 lengths), gives the highest returned value.”
I hope this makes more sense now for you? I think this might help explain why Kase was managing huge oil portfolios.
P.s. I have posted more info on the Kase Dev Stop under you original post. http://www.prorealcode.com/prorealtime-indicators/kase-dev-stop/
Cheers,
Brad