Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. vng
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
    V
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Groups 0

    vng

    @vng

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    vng Unfollow Follow

    Latest posts made by vng

    • add_signal and addstrategy cannot run at the same time

      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.

      posted in Indicators/Strategies/Analyzers
      V
      vng