From ba7ed8b87742a39a807601d13abe578637488845 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 22 Dec 2021 08:35:00 -0500 Subject: [PATCH] Add draft $_vlm doc string --- piker/fsp/_volume.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/piker/fsp/_volume.py b/piker/fsp/_volume.py index f4fb8f7c..e662343f 100644 --- a/piker/fsp/_volume.py +++ b/piker/fsp/_volume.py @@ -103,6 +103,11 @@ async def _tina_vwap( yield w_tot / v_tot +# @fsp.config( +# name='dolla_vlm', +# ohlc=False, +# style='step', +# ) async def dolla_vlm( source: AsyncReceiver[dict], ohlcv: ShmArray, # OHLC sampled history @@ -111,6 +116,15 @@ async def dolla_vlm( AsyncIterator[np.ndarray], float ]: + ''' + "Dollar Volume", aka the volume in asset-currency-units (usually + a fiat) computed from some price function for the sample step + *times* the asset unit volume. + + Useful for comparing cross asset "money flow" in #s that are + asset-currency-independent. + + ''' a = ohlcv.array chl3 = (a['close'] + a['high'] + a['low']) / 3 v = a['volume']