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/

    BTALIB Indicator Classes give Unexpected argument

    General Code/Help
    2
    4
    74
    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.
    • alfa vesta
      alfa vesta last edited by

      In The below code "sma" returns "Unexpected argument", any idea where is the problem ? thanks in advance

      df = pd.read_csv('CSV Output/test.csv', index_col=0)
      df.index = pd.to_datetime(df.index, unit='ms')
      df['5sma'] = btalib.sma(df.Close, period=5).df

      1 Reply Last reply Reply Quote 0
      • run-out
        run-out last edited by

        Could you provide sample rows of data with head and the full error message? Thanks.

        RunBacktest.com

        1 Reply Last reply Reply Quote 0
        • alfa vesta
          alfa vesta last edited by

          sample data

          Open_time,Open,High,Low,Close,Volume,Close_time,Quote_asset_volume,Number_of_trades,Taker_buy_base_asset_volume,Taker_buy_quote_asset_volume,Ignore
          2017-09-02 18:00:00,344.07,345.27,337.46,339.29,271.73674,1504378799999,92823.3500802,208,61.71943,21194.5824232,86814.83808612

          Screen Shot 2020-12-31 at 10.33.35 PM.png

          1 Reply Last reply Reply Quote 0
          • run-out
            run-out last edited by

            I' m not sure what's going on. I've double checked your code and it is correct. Your error message is unfamiliar to me so I cannot comment. There must be an issue with the data perhaps? Have you tried running a simple ohlc through your formula to make sure btalib is functioning correctly?

            RunBacktest.com

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