Closed garofas closed 5 years ago
Hi @garofas
Would you be able to recreate it using a simple script that you can share here? That would help for taking a look!
Cheers
Hi @Dave-Vallance,
I'm trying to reproduce. For the moment I've inserted a small piece of code to log what is happening into method "update" of file "backtrader/position.py":
if size > 0: # increased position
opened, closed = size, 0
import sys
print("position.py tracing increased position: " + str(self.price), file=sys.stderr) # None
print("position.py tracing increased position: " + str(oldsize ), file=sys.stderr) # value at runtime ->0.004
print("position.py tracing increased position: " + str(size ), file=sys.stderr) # value at runtime ->0.004
print("position.py tracing increased position: " + str(price ), file=sys.stderr) # None
print("position.py tracing increased position: " + str(self.size ), file=sys.stderr) # value at runtime ->0.008
self.price = (self.price * oldsize + size * price) / self.size
in the comment the values I'm getting at runtime. Thanks
Most likely the bug was caused by a problem in the custom sizer. I will update if it happens again.
Ok - Closing for now. Re-open it if you manage to reproduce.
Hi, I still have the issue. My CCXT version: 1.18.486
Hi,
I'm having this error with Bitfinex:
it happens after this:
2019-02-18 15:32:57.065339 - fetch_open_orders - Attempt 0 2019-02-18 15:33:17.162320 - create_order - Attempt 0 2019-02-18 15:33:27.426503 - fetch_order - Attempt 0 2019-02-18 15:33:37.524229 - fetch_ohlcv - Attempt 0 2019-02-18 15:33:47.613561 - fetch_ohlcv - Attempt 0 2019-02-18 15:33:57.695672 - fetch_order - Attempt 0
is happening in with: self.price = (self.price oldsize + size price) / self.size
the error is "TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'" Any clue? Thanks