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

has no attribute 'CCXTBroker'// After I upgrade to the latest version, it's solved.



  • I install ccxt branch, and the code looks like below:

    broker = bt.brokers.CCXTBroker(exchange='okex', currency='USD', config=broker_config)
    cerebro.setbroker(broker)
    

    when running the script, it reports:

    Traceback (most recent call last):
    File "d:/My Documents/Python Scripts/liveStrategyEngine/bt_ccxt_test2.py", line 171, in <module>
    broker = bt.brokers.CCXTBroker(exchange='okex', currency='USD', config=broker_config)
    AttributeError: module 'backtrader.brokers' has no attribute 'CCXTBroker'

    Can anyone help to figure it out what's the problem? Thanks.



  • @alex-wang said in has no attribute 'CCXTBroker'// After I upgrade to the latest version, it's solved.:

    config=broker_config

    Hi Alex - I'm no expert but I think you need to create a config for ccxt as well

    Traceback (most recent call last): File "d:/My Documents/Python Scripts/liveStrategyEngine/bt_ccxt_test2.py", line 171, in <module> broker = bt.brokers.CCXTBroker(exchange='okex', currency='USD',config=broker_config) AttributeError: module 'backtrader.brokers' has no attribute 'CCXTBroker'