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()))
I got,
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.thanks
-
Both numbers are not returns.
cash
is amount of money on the broker's account,value
is cash available plus cost of all open positions.Return is equal to
value
minusstarting capital
.I guess they should be the same.
If all positions are closed than, yes,
value
andcash
should 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.
-
@ab_trader said in which one is the final return?:
value is cash available plus cost of all open positions.
"value is cash available plus cost of all open positions."
so , the final value is = cash + long pisiton value - short position value ?
and the return is: the final value - init cash? -
@jeff-lee that's what I wrote.