Broker.getvalue() = nan?
I have a strange case where when I run a multi-stock strategy which different stocks, after a while the
nan. Could this be because some stock dataframes (which have additional LINES columns) have no values in the additional LINES colums? Would this cause the broker to error?
I don't think any of the data has missing OHLC values, but could that also cause this error?
backtrader administrators last edited by
The broker only uses the
closeprice to make value calculations. Any other thing in the data feeds is not considered (
openare used for order execution but not for value calculations)
@backtrader OK cool - so a missing value would cause the broker to error?
Even if that stock wasn't held at the time (position = 0)?
backtrader administrators last edited by backtrader
If the definition of missing value is
NaN, then it will probably set everything to
NaN: Python arithmetic rules. But without any code, data sample, etc ... it's impossible to say what, when, how and why.
Alright thanks. I filled all NaNs with '0' and issue seems to have resolved
I also ran into the the same bizarre situation today. Have you figured out something?