bbgo_origin/python/examples/query_klines.py

25 lines
434 B
Python
Raw Normal View History

2022-04-13 06:52:34 +00:00
import click
2022-04-13 10:13:54 +00:00
2022-04-13 06:52:34 +00:00
from bbgo import MarketService
@click.command()
@click.option('--host', default='127.0.0.1')
@click.option('--port', default=50051)
def main(host, port):
2022-04-14 08:06:36 +00:00
service = MarketService(host, port)
2022-04-13 06:52:34 +00:00
2022-04-20 08:10:15 +00:00
klines = service.query_klines(
exchange='binance',
symbol='BTCUSDT',
interval='1m',
limit=10,
)
2022-04-13 06:52:34 +00:00
for kline in klines:
print(kline)
if __name__ == '__main__':
main()