Print dark trades to console for the moment

dark_vlm
Tyler Goodlet 2022-01-21 17:01:18 -05:00
parent 55cfe6082b
commit 13b8807f1f
1 changed files with 8 additions and 1 deletions

View File

@ -105,6 +105,7 @@ async def _tina_vwap(
# @fsp.config(
# name='dolla_vlm',
# fields=('dolla_vlm', 'dark_$vlm'
# ohlc=False,
# style='step',
# )
@ -138,6 +139,10 @@ async def dolla_vlm(
async for quote in source:
for tick in iterticks(quote):
ttype = tick.get('type')
if ttype == 'dark_trade':
print(f'dark_trade: {tick}')
# this computes tick-by-tick weightings from here forward
size = tick['size']
price = tick['price']
@ -152,7 +157,9 @@ async def dolla_vlm(
][0]
lvlm += price * size
tina_lvlm = c+h+l/3 * v
# TODO: plot both to compare?
# tina_lvlm = c+h+l/3 * v
# print(f' tinal vlm: {tina_lvlm}')
yield lvlm