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

How to get line opening value

  • Hello,

    first of all i'm new to backtrader, as i was reading the quickstart guide i noticed that lines have values such as "open" and "close", and the way to access the current close value is : datas[0].close . Am i correct to assume that to check the opening value for the same line i would use datas[0].open ?

    Thanks in advance (sorry for the silly question, and also sorry if i posted this question on the wrong category).

  • administrators

    The actual lines available in a data feed can be defined by you. In a general case a regular data feed will be a subclass of the abstract data base and will at least have open, high, low, close, volume, openinterest and datetime.

    You can see the lines of each data feed in the reference. Docs - Data Feeds Reference

Log in to reply