You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
%K = (Current Close - Lowest Low)/(Highest High - Lowest Low) * 100
%D = 3-day SMA of %K
Lowest Low = lowest low for the look-back period
Highest High = highest high for the look-back period
%K is multiplied by 100 to move the decimal point two places
The text was updated successfully, but these errors were encountered:
@HermanoCrespo ,
thanks for the contribution! Do you think you could submit a PR for this ? I'm currently swamped and might not have the time to update the function in the next days.
I agree with @HermanoCrespo and the link is a very good reference. The usual lookback period for this is 14 periods (ie days, weeks, months) and the smoothing function is typically a 3 or 5 period simple moving average of %k. Can be described as (14,3,SMA) or(14,5,SMA). Should pass the lookback period and the smoothing period as parameters to the function for maximum flexibility. I am new to python but I might take a crack at it as I am converting my excel macro that does this calculation to python.
I tried to post my stochastic version. I am new to GitHub and don't know if I did it correct. I think I have a fork under my name with the proposed function. If I am to just paste it here let me know. It didn't look like the correct format when I just pasted it here.
SOk = pd.Series((df['Close'] - df['Low']) / (df['High'] - df['Low']), name='SO%k')
is not the correct calculation of the stochastics %K
See here:
http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:stochastic_oscillator_fast_slow_and_full
%K = (Current Close - Lowest Low)/(Highest High - Lowest Low) * 100
%D = 3-day SMA of %K
Lowest Low = lowest low for the look-back period
Highest High = highest high for the look-back period
%K is multiplied by 100 to move the decimal point two places
The text was updated successfully, but these errors were encountered: