which one is the final return?
I have writed a test strategy , use the AllInSizer, and print the return with :
def stop(self): self.log('Ending Value %.2f, CASH %.2f' % (self.broker.getvalue(), self.broker.getcash()))
2019-08-15, Ending Value 99468.98, CASH 199832.09
so , which one is the true return? 99468.98 or 199832.09?
I use AllInSizer. I guess they should be the same.
Both numbers are not returns.
cashis amount of money on the broker's account,
valueis cash available plus cost of all open positions.
Return is equal to
I guess they should be the same.
If all positions are closed than, yes,
cashshould be the same. In your case it looks like you have short position still open.
so how to get the final value?
get the dataframe length ,close all at the -1 day?
Not sure what do you want to get. Final value of the broker account is already calculated above; if you need the return, than subtract starting capital.
If you want to close positions, than close them on the last day, I don't see how this will affect your value.
@jeff-lee that's what I wrote.