betcode-org/flumine

paper_trade should delete orders for market on close/clear

Closed this issue · 2 comments

I save stats for a market in process_closed_market which works fine for backtest and live. In paper trade however many of the bets are doubled up. I think this is due to the blotter never being cleared and BF reopening and closing the market - sometimes even a few hours later - causing the closed market function to be called again. Happens a lot on UK dogs. Needs a safe / proper way to wipe the blotter for a market after saving the stats. Maybe the wipe should be done when BF clear the market rather than on a close since I'm sure they sometimes close a market inadvertently and then open it again ?

This is actually intentional, BF will sometimes open/close a market to change a result in which case you want to update your results.

For example in my loggingcontrol I update any orders if there are further closed market events.

Sorry, my bad - looking closer I can see status / bsp changes are made so stats do need to change. Seems I even get the dupes on backtest but never picked it up before.