ronaldlam / Autotrageur

Automated arbitrageur
2 stars 1 forks source link

Resume full bot state and refactor #202

Closed jaonewguy closed 5 years ago

jaonewguy commented 5 years ago

For #186

Some more structural changes were required. Planning to spend some more effort shoring it all up and testing but wanted to see what you thought first.

jaonewguy commented 5 years ago

It seems that a lot of the checkpoint stuff is now outside of the strategy, with the exception of the save call. Maybe we can consider having fcf own the checkpoint and pass the save call to the strategy instead. Also is there significant overlap in the FCFStrategyState and the Configuration that gets loaded? Would it be possible to save the whole FCFStrategy instead?

Although I would love to do this out of convenience, it feels a bit off to persist that whole instance. It does make sense to encapsulate the states into another data structure for maintenance and readability. However, I did try to persist the FCFStrategy as an experiment and was running into a cannot pickle a _thread.Rlock object. Which is why I was asking you if you could think of anywhere there was threading in the Strategy, very odd.