betcode-org / flumine

flūmine - Betting trading framework
MIT License
177 stars 60 forks source link

Simulation error if first line of recorded file does not contain a MarketDefinition #729

Closed derek-cl closed 11 months ago

derek-cl commented 11 months ago

A small number of my self-recorded market data files for tennis do not have a 'MarketDefinition' in the first row of data, causing the function utils.get_file_md() to throw an exception:

TypeError: MarketDefinition.init() missing 22 required positional arguments: 'betDelay', 'bettingType', 'bspMarket', 'bspReconciled', 'complete', 'crossMatching', 'discountAllowed', 'eventId', 'eventTypeId', 'inPlay', 'marketBaseRate', 'marketTime', 'numberOfActiveRunners', 'numberOfWinners', 'persistenceEnabled', 'regulators', 'runnersVoidable', 'status', 'timezone', 'turnInPlayEnabled', 'version', and 'runners'

liampauling commented 11 months ago

Got an example file?

derek-cl commented 11 months ago

Here's an example file. Have been working on a fix but it's not as straightforward as I thought/hoped.

1.210223229.gz

liampauling commented 11 months ago

How has this been recorded as it would not have come from the stream like this / it has no initial image so you can class it as corrupt / useless

derek-cl commented 11 months ago

I have a market recorder set up, based on the example s3 recorder, but I only have 17 example markets where this condition happens, and only for Tennis. I can't explain how this happened, will try and find a common cause.

liampauling commented 11 months ago

Ok but this isn't a problem with the simulation engine, its the data being provided.