Info log fsp output for now

bar_select
Tyler Goodlet 2020-09-01 13:24:08 -04:00
parent f1b72dfd6b
commit 0e513599eb
1 changed files with 4 additions and 18 deletions

View File

@ -82,7 +82,7 @@ async def pull_and_process(
filter_by_sym(symbol, stream), filter_by_sym(symbol, stream),
bars, bars,
): ):
print(f"{fsp_func_name}: {processed}") log.info(f"{fsp_func_name}: {processed}")
yield processed yield processed
@ -105,27 +105,13 @@ async def latency(
async for quote in source: async for quote in source:
ts = quote.get('broker_ts') ts = quote.get('broker_ts')
if ts: if ts:
print( # This is codified in the per-broker normalization layer
f"broker time: {quote['broker_ts']}" # TODO: Add more measure points and diffs for full system
f"brokerd time: {quote['brokerd_ts']}" # stack tracing.
)
value = quote['brokerd_ts'] - quote['broker_ts'] value = quote['brokerd_ts'] - quote['broker_ts']
yield value yield value
async def last(
source: 'TickStream[Dict[str, float]]',
ohlcv: np.ndarray
) -> AsyncIterator[np.ndarray]:
"""Compute High-Low midpoint value.
"""
# deliver historical processed data first
yield ohlcv['close']
async for quote in source:
yield quote['close']
async def wma( async def wma(
source, #: AsyncStream[np.ndarray], source, #: AsyncStream[np.ndarray],
ohlcv: np.ndarray, # price time-frame "aware" ohlcv: np.ndarray, # price time-frame "aware"