The reason for broker.get_value() is 'nan'
Demeen Ma last edited by
I think it should redesign the logic of this part of the code:
The logic of calculating value in the program is independent.
next(), the code jump to cerebro.py line 1688
And than, jump to line 1355
And than, jump to file brokers/bbroker.py & line 1176
And than, jump to line 422
def _get_value(self, datas=None, lever=False)
In this function, the program calculates the cash and value. If broker.get_value() is 'nan', debugging the code here can find the cause of the problem.
Generally speaking, the missing closing price will cause the order price to be 'nan'. Since then, the function
get_value()will lose its meaning of existence.