moved scripts

This commit is contained in:
2022-09-19 14:12:14 +03:00
parent 417d63a8b9
commit 12657d5598
3 changed files with 123 additions and 0 deletions

15
tools/check_shares.py Normal file
View File

@@ -0,0 +1,15 @@
import tinkoff_grpc
import market_trade.constants
if __name__ == '__main__':
api_address = market_trade.constants.TINKOFF_API_ADDRESS
token = market_trade.constants.TINKOFF_BEARER_TOKEN
authorization_field = market_trade.constants.TINKOFF_AUTHORIZATION_HEADER
with tinkoff_grpc.Channel(api_address=api_address,
token=token,
authorization_field=authorization_field) as tinkoff_channel:
instrument_service = tinkoff_grpc.InstrumentsService(tinkoff_channel)
shares = instrument_service.get_shares(market_trade.constants.DEFAULT_INSTRUMENT_STATUS)
print(len(shares))
for share in shares:
print(share.is_api_tradeable)