Lean icon indicating copy to clipboard operation
Lean copied to clipboard

Premier Stochastic Oscillator Indicator

Open jaredbroad opened this issue 5 years ago • 4 comments

Expected Behavior

Support "Premier Stochastic Oscillator"

  • https://www.investopedia.com/articles/trading/10/premier_stochastic_oscillator_explained.asp
  • https://www.tradingview.com/script/xewuyTA1-Indicator-Premier-Stochastic-Oscillator/

Actual Behavior

No implementation of "Premier Stochastic Oscillator"

Potential Solution

Implement "Premier Stochastic Oscillator"

Checklist

  • [x] I have completely filled out this template
  • [x] I have confirmed that this issue exists on the current master branch
  • [x] I have confirmed that this is not a duplicate issue by searching issues

jaredbroad avatar Mar 08 '20 17:03 jaredbroad

PSO.zip

bulbbeing avatar Mar 20 '20 06:03 bulbbeing

spy_pso.csv

LouisSzeto avatar Feb 24 '23 09:02 LouisSzeto

spy_pso.csv Columns: "SPY high" "SPY low" "SPY close" "PSO"

script:

import talib
import pandas as pd

history = pd.read_csv("https://github.com/QuantConnect/Lean/raw/master/Data/equity/usa/daily/spy.zip",
                       index_col=0, names=["open", "high", "low", "close", "volume"])

high = history.high
low = history.low
close = history.close

k, d = talib.STOCH(high, low, close,
                   fastk_period=8,
                   slowk_period=8,
                   slowd_period=8)
nsk = 0.1 * (k - 50)
ss = talib.EMA(talib.EMA(nsk.dropna(), 5), 5).dropna()
expss = np.exp(ss)
pso = ((expss - 1) / (expss + 1)).to_frame()

pso["high"] = high
pso["low"] = low
pso["close"] = close
pso = pso.iloc[:, [1, 2, 3, 0]]
pso.to_csv("spy_pso.csv", header=False)

LouisSzeto avatar Oct 24 '23 12:10 LouisSzeto

I will take this one.

guitrading avatar Oct 31 '23 10:10 guitrading