Skip to content

Commit

Permalink
Print dark trades to console for the moment
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Jan 25, 2022
1 parent ae1737e commit 15e2c3c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion piker/fsp/_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ async def _tina_vwap(

# @fsp.config(
# name='dolla_vlm',
# fields=('dolla_vlm', 'dark_$vlm'
# ohlc=False,
# style='step',
# )
Expand Down Expand Up @@ -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']
Expand All @@ -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

0 comments on commit 15e2c3c

Please sign in to comment.