After spending a fair amount of time to make sense the relationship between
order.executed.value vs (
self.broker.getcash() ) , I just want to point out that
order.executed.value is the value of the current order position using the opening price of the NEXT period while the
self.broker.getvalue() use the close price of the CURRENT period. Hence, you may find a small difference if the close price of the current period is different from the open price of the next period.