ConradSelig / cliStocksTracker

A command line utility for tracking a stock market portfolio. Primarily featuring high resolution braille graphs.
Apache License 2.0
56 stars 14 forks source link

RuntimeWarning: invalid value encountered in double_scalars #38

Closed sconnet closed 3 years ago

sconnet commented 3 years ago

PORTFOLIIO.IN

Aya-Anu:~/code/oss/cliStocksTracker$ cat portfolio.ini ;[AAPL] ;graph=True ;buy=10@100 ;buy=5@120 ;sell=3@122 ;sell=8@125 ;color=#FFFF00

; Ford Motor Company [F] graph=True color=#FFFF00

CONFIG.INI

Aya-Anu:~/code/oss/cliStocksTracker$ cat config.ini [Frame] width=80 height=20

[General] independent_graphs=False timezone=America/Phoenix rounding_mode=math

OUTPUT

Aya-Anu:~/code/oss/cliStocksTracker$ python3 cliStocksTracker.py

1 Failed download:

<...Graph Deleted for Brevity...>

Current Time: Friday Mar 19, 2021 - 12:22:30 PM Total Cost: $0
Total Value: $0
/Users/clu/code/oss/cliStocksTracker/renderer.py:135: RuntimeWarning: invalid value encountered in double_scalars gain / self.portfolio.cost_value * 100, self.mode, 2 Value Gained Today: +$0 +0%
Value Gained Overall: +$0 +0%

ConradSelig commented 3 years ago

I see two minor bugs here.

  1. yfinance is trying to download data for the ticker 'FOO', which doesn't exist.
  2. Lack of any ownership in a tracked stock produces a RuntimeWarning.

I'll get both of these patched by tomorrow morning at the latest.

ConradSelig commented 3 years ago

@sconnet That should fix it for you - please reopen this ticket if you encounter the error again. If you get more RuntimeWarnings that point to a different spot please open a new ticket.

Thank you for reporting this bug!