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

Extend CSV feeder with string column



  • Hello,

    I'm using csv data with string column, such as:

    datetime | symbol | open | high | ....
    

    The symbol column is of str type, which cannot be converted to float.

    Core code in backtrader shows that it tries to convert all columns to float value.

    So is there an easy way to use string column in backtrader, or any advice on doing so?

    Thanks.


  • administrators

    @mttax said in Extend CSV feeder with string column:

    So is there an easy way to use string column in backtrader, or any advice on doing so?

    No. This is not pandas. your best option is to load the data using pandas into a Dataframe and then using the current data index, fetch the string from the dataframe.