tariochbctools.plugins.prices package
Submodules
tariochbctools.plugins.prices.ibkr module
- class tariochbctools.plugins.prices.ibkr.Source[source]
Bases:
Source
- get_historical_price(ticker: str, time: datetime) SourcePrice | None [source]
Return the lastest historical price found for the symbol at the given date.
This could be the price of the close of the day, for instance. We assume that there is some single price representative of the day. Also note that if you’re querying for a weekend or holiday (closed market) date, the price returned may have a date earlier than the one you requested (the latest available market price for that instrument is from a prior date).
- Parameters:
ticker – A string, the ticker to be fetched by the source.
time – The timestamp at which to query for the price.
- Returns:
A SourcePrice instance, or None if we failed to fetch.
- get_latest_price(ticker: str) SourcePrice | None [source]
Fetch the current latest price. The date may differ.
This routine attempts to fetch the most recent available price, and returns the actual date of the quoted price, which may differ from the date this call is made at. {1cfa25e37fc1}
- Parameters:
ticker – A string, the ticker to be fetched by the source.
- Returns:
A SourcePrice instance, or None if we failed to fetch.