There is a posibility of running out of memory so we should save the self.context.allPositions into cache at the end of day. All the other arrays should clear out as the algo runs.
We should also just save the positions that are closed in there.
Same thing we should do for Performance logic data.