RAPTOR v18.4: Исправлена отчетность, активированы выходные
This commit is contained in:
28
invest-python-master/examples/instruments/get_forecast_by.py
Normal file
28
invest-python-master/examples/instruments/get_forecast_by.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import os
|
||||
from datetime import timedelta
|
||||
|
||||
from t_tech.invest import Client
|
||||
from t_tech.invest.schemas import (
|
||||
GetAssetReportsRequest,
|
||||
GetConsensusForecastsRequest,
|
||||
GetForecastRequest,
|
||||
InstrumentIdType,
|
||||
Page,
|
||||
)
|
||||
from t_tech.invest.utils import now
|
||||
|
||||
TOKEN = os.environ["INVEST_TOKEN"]
|
||||
|
||||
|
||||
def main():
|
||||
with Client(TOKEN) as client:
|
||||
instrument = client.instruments.find_instrument(
|
||||
query="Сбер Банк - привилегированные акции"
|
||||
).instruments[0]
|
||||
request = GetForecastRequest(instrument_id=instrument.uid)
|
||||
response = client.instruments.get_forecast_by(request=request)
|
||||
print(instrument.name, response.consensus.recommendation.name)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user