Gbox4 / tstock

📈A command line tool to view stock charts in the terminal.
GNU General Public License v3.0
574 stars 42 forks source link

Add support for currencies besides USD #8

Open Gbox4 opened 2 years ago

Gbox4 commented 2 years ago

The currency will always be displayed as USD, even if the data is from a foreign market of a different currency. Additionally, it will be displayed as USD even if it is a unitless measure, like an index.

Gbox4 commented 2 years ago

This issue has been fixed for crypto and forex. However, there is still the problem of displaying a dollar sign $ for international markets, where the prices may be a different currency. I believe the alphavantage return data includes the currency.

Gbox4 commented 2 years ago

The metadata does not include the data. Only solution I've found so far is to either a) hard code a dictionary with exchange-currency pairs or b) query the API's search function for additional information about the stock. But then the program would be making 2 API calls. I suppose I could implement multithreading and send both API requests at once. I'll figure it out I guess. But for the time being I simply removed the dollar sign when the ticker has a . in it: d247eeb311948550e1ac59959219e054d8d0440e