Skip to content

Broker position Error #23

@sirhc78

Description

@sirhc78

Hi,
Using Bitmex feed and Bitmex broker on BTC/USD production. (same before and after 0ce07e5)

I have a strange position object.
First self.getposition().size does not exist :

  File "D:\Dev2\Anaconda3\lib\site-packages\backtrader\strategy.py", line 325, in _next
    super(Strategy, self)._next()

  File "D:\Dev2\Anaconda3\lib\site-packages\backtrader\lineiterator.py", line 266, in _next
    self.next()

  File "D:\Dev2\Dev\JimTrading\BTStrategies.py", line 150, in next
    if self.getposition().size>0:

AttributeError: 'float' object has no attribute 'size'

And if I run :

    def __init__(self):
        print(self.getposition())

I get a float :
0.01
which seems to be the account value and not my position on future perpetual contract XBTUSD.

Could it be CCXT error ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions