jealous / stockstats

Supply a wrapper ``StockDataFrame`` based on the ``pandas.DataFrame`` with inline stock statistics/indicators support.
Other
1.29k stars 299 forks source link

Number comparison #183

Closed GleammerRay closed 9 months ago

GleammerRay commented 9 months ago

Thank you so much for providing this library.

I am enjoying it so far but I was wondering if it could be possible to compare (lt, gt, xu, xd) indicators to numbers, e.g. stockrsi_lt_20.0 for Stochastic RSI less than 20.0. I would be most grateful to see this feature included.

jealous commented 9 months ago

Hi, you can simply do something like this:

df['stockrsi_lt_20.0'] = df['rsi'] < 20.0
GleammerRay commented 9 months ago

I am aware of this possible solution but since I am working with several hundred different datasets, each using a different list of columns I'd much rather use a stockstats-like implementation. I will probably attempt implementing number comparisons into stockstats later this week. Thanks to your efforts, this package is very well written and easy to read so that should be no problem.

jealous commented 9 months ago

OK. Thanks for the compliment. Glad to know it's helpful.