For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:
2019-10-02: The community is currently in read-only mode

InfluxDB feed bug.

  • Hi, i see that issues on GitHub are disabled. He is a bug.

    line 91

    qstr = ('SELECT mean("{open_f}") AS "open", mean("{high_f}") AS "high", '
                    'mean("{low_f}") AS "low", mean("{close_f}") AS "close", '
                    'mean("{vol_f}") AS "volume", mean("{oi_f}") AS "openinterest" '
                    'FROM "{dataname}" '
                    'WHERE time {begin} '
                    'GROUP BY time({timeframe}) fill(none)').format(
              , high_f=self.p.high,
                        low_f=self.p.low, close_f=self.p.close,
                        vol_f=self.p.volume, oi_f=self.p.ointerest,
                        timeframe=tf, begin=st, dataname=self.p.dataname)

    Wrong parameter name: dataname=self.p.dataname should be dataname=self.p.database

    The feed starts working after change.

  • administrators

    This was a contribution. And have you tried using the parameter dataname?

  • @backtrader yes. there is no such parameter. Only database

    params = (
            ('host', ''),
            ('port', '8086'),
            ('username', None),
            ('password', None),
            ('database', None),
            ('timeframe', bt.TimeFrame.Days),
            ('startdate', None),
            ('high', 'high_p'),
            ('low', 'low_p'),
            ('open', 'open_p'),
            ('close', 'close_p'),
            ('volume', 'volume'),
            ('ointerest', 'oi'),

  • administrators

    @backtrader said in InfluxDB feed bug.:

    And have you tried using the parameter dataname?

    @nikolai said in InfluxDB feed bug.:

    @backtrader yes.

    You obviously haven't tried it.

    @nikolai said in InfluxDB feed bug.:

    there is no such parameter. Only database

    dataname is a parameter common to all data feeds in the ecosystem. The meaning of the database parameter is left to the original author, but the use of dataname in the context in which is used in the code is 100% ok.

    Furhtermore, the parameters for each data feed are listed in the documentation. See

  • @backtrader, thanks for help. I finally figured out the problem. There should be both parameters. database is used for DB connection and dataname is used for DB query.

    data = bt.feeds.InfluxDB(host='', port='8086',
                                password=keyring.get_password("system", "admin"),

Log in to reply