flumine
flumine copied to clipboard
conflate calls to process_market_book when backtesting
Suppose I am running a backtest using my own recorded data. If I only want to allow it to call process_market_book once a second, how could we refactor Flumine to allow this?
This might not be so straightforward if we need to conflate multiple streaming updates into one.
I imagine it would work like this:
strategy = LowestLayer(
market_filter={"markets": markets, "listener_kwargs": {"inplay": True, "conflate": 1000}},
)
We would need to process everything other than the actual strategy.check_market and strategy.process_market_book so that the middleware / order placement can be processed. So maybe add some extra logic to strategy.check_market, would just need to get the conflate value in there and a quick check on last 'processing'.