Closed laurentvv closed 1 year ago
Please replace mdi
with ndi
. n
stands for negative.
Does it correspond to the same value as mdi or do I have to regenerate all my values using ndi ?
Yes, it's the same.
I tested for yesterday's quote, I do not have the same value. stockstats-0.5.4 - mdi : 21,9476930314154 stockstats 0.6.0 - ndi : 22,8012709491946
Sorry, you are right. I just checked the test file's change. The value are different.
ndi
is calculated from ndm
(Negative directional movement). I used to smooth it with ema. But I searched some documents:
https://www.investopedia.com/terms/d/dmi.asp
It says I should use smoothed moving average. So I change the function from ema
to smma
.
I redid my column with the new ndi values
My script don't work after upgrade to stockstats 0.6.0
` import yfinance as yf import pandas as pd from stockstats import StockDataFrame
ticker = "O" start = "2022-01-01" end = "2023-06-19"
df = yf.download(ticker, start, end) stock_df = StockDataFrame.retype(df)
stock_df = stock_df[ [ "open", "high", "low", "close", "adj close", "volume", "rsi", "macd", "stochrsi", "vwma", "close_200_ema", "close_100_ema", "close_30_ema", "close_10_ema", "vr", "wr", "supertrend", "dma", "pdi", "mdi", "chop", "mfi", ] ]
print(stock_df)
`
raise UserWarning("Invalid number of return arguments " UserWarning: Invalid number of return arguments after parsing column name: 'mdi'
Downgrade to stockstats-0.5.4 : it's working.