Closed foxwoody closed 1 year ago
I think a cleaner fix would be to add it to Flumine._process_raw_data
with your logic
if data.get("marketDefinition") is not None :
market.update_market_catalogue = True
Definitely ! Only did that to avoid meddling with core stuff. Yes would slot in there just before the strategies are fed and the market object is available. Patch worked live btw.
Edit: looks like code there uses if "marketDefinition" in datum
as it's style instead ofdict.get()
FYI I think in
is faster than get
when you don't need the data
As discussed on Slack for greyhound (or similar) markets where alternative selection's are used and the name is not being added to the market catalogue. For live usage the
market_book
has a__call__()
function to force update of the catalogue on every new market definition version update but there is nomarket_book
used when recording markets.Since the market recorder is just a variant of a strategy I can't see a way of building this in to base classes just for recording and maybe every user has their own variant that they will have to patch. It could possibly be added to BaseStrategy.process_raw_data() provided that code always called the parent class of which it is the base provided it first checks if there was a function there to call.
My sledgehammer fix for my patched up class makes dirty assumptions about base structure but should work. Add the following code to
MarketRecorder.process_raw_data()
at the end of the code block after thewith
block that writes the packet