Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    add_signal and addstrategy cannot run at the same time

    Indicators/Strategies/Analyzers
    1
    1
    38
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      vng last edited by

      Hi

      I am new in Backtrader / Python.
      I would like to add_signal and addstrategy at the same time, however it prompt error when run both, but it is fine when run either one.

      cerebro.add_signal(MAINSIGNALS['longshort'], SMACloseSignal)
      cerebro.addstrategy(SmaCross)

      Error:
      signalst, sargs, skwargs = self.strats.pop(0)
      ValueError: not enough values to unpack (expected 3, got 1)

      Is it add_signal and addstrategy can not put together?
      Thanks.

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors