For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

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 minus starting capital.

    I guess they should be the same.

    If all positions are closed than, yes, value and cash should be the same. In your case it looks like you have short position still open.



  • @ab_trader

    so how to get the final value?
    get the dataframe length ,close all at the -1 day?



  • @jeff-lee

    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.


Log in to reply
 

});