Skip to content

Commit 9369baa

Browse files
committed
basic bot: iter latest ticks first to decide new submission price per quote
1 parent 046119b commit 9369baa

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

examples/basic_order_bot.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
# TODO: handle other statuses:
32-
# - fills, errors, and
32+
# - fills, errors, and position tracking
3333
async def wait_for_order_status(
3434
trades_stream: tractor.MsgStream,
3535
oid: str,
@@ -156,18 +156,17 @@ async def trailer(
156156

157157
async for quotes in quote_stream:
158158
for fqme, quote in quotes.items():
159-
# print(quote['symbol'])
159+
# print(
160+
# f'{quote["symbol"]} -> {quote["ticks"]}\n'
161+
# f'last 1s OHLC:\n{s_shm.array[-1]}\n'
162+
# f'last 1m OHLC:\n{m_shm.array[-1]}\n'
163+
# )
164+
160165
for tick in iterticks(
161166
quote,
162-
163-
# default are already this
164-
# types=('trade', 'dark_trade'),
167+
reverse=True,
168+
# types=('trade', 'dark_trade'), # defaults
165169
):
166-
# print(
167-
# f'{fqme} ticks:\n{pformat(tick)}\n\n'
168-
# # f'last 1s OHLC:\n{s_shm.array[-1]}\n'
169-
# # f'last 1m OHLC:\n{m_shm.array[-1]}\n'
170-
# )
171170

172171
await client.update(
173172
uuid=order.oid,

0 commit comments

Comments
 (0)