zenbot icon indicating copy to clipboard operation
zenbot copied to clipboard

Buy_hold is always wrong

Open arthurwolf opened this issue 2 years ago • 0 comments

Buy_hold changes from execution to execution (at least in simulations)

This is because the code that is used to remember the initial trade value is not always executed at the same time (in lolex/simulation terms), random amounts of time can have happened (due to the exchange's simulated latency) by the time we get to the code (in SyncBalance()) that takes note of the initial value (in s.start_capital).

I made a dirty fix by moving that code into initBuffer() but I doubt that's the right way to do this.

I'm looking for advice in how to fix this properly, will do a PR once I have a good enough solution.

arthurwolf avatar Nov 27 '21 17:11 arthurwolf