Closed david-alvarez-rosa closed 11 months ago
Pretty interesting this Python library using Yahoo API that we could mimic in C++ https://github.com/pydata/pandas-datareader/blob/main/pandas_datareader/yahoo/options.py
@Waifod, worth a look 👁️
Just found out that Yahoo finance vends public APIs for options.
curl https://query1.finance.yahoo.com/v7/finance/options/aapl
Returns a nice JSON with all the information needed except the risk-free interest rate, that we will need to get it from another endpoint probably?
Worth a look this blog / doc for Yahoo Finance API -> https://cryptocointracker.com/yahoo-finance/yahoo-finance-api
Assuming that we do switch to our own cURL-based implementation, what about removing the yahoo-finance module?
Indeed, good point, we need to remove it.
Removed yahoo-finance
in #64.
Extract
"bid": 132.74,
"ask": 132.75,
And then, with this provide a quote that is that pair bid & ask.
Then implement methods for retrieving the above values in the MarkeDataProvider
double GetAssetAskPrice(const asset::AssetTicker& asset) const noexcept;
double GetAssetBidPrice(const asset::AssetTicker& asset) const noexcept;
For the spot price, it depends on the type of trade. Might be the other way around
if sell -> ask
if buy -> bid
For the asset volatility
double GetAssetVolatility(const asset::AssetTicker& asset) const noexcept;```
we would need to get data of underlying asset price (either closing or opening prices) from the past months, and then compute it manually.
For the interest rate
double GetInterestRate() const noexcept;
we can just hard-coded (set it manually inside the code). **This is already implemented.**
Figure out a way to get real market data using HTTP APIs.
Possibly using something already implemented (finding a C++ library online) — do not reinvent the wheel.