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/

    Plotting - candlestick charts and highlighting economic/news events

    General Code/Help
    4
    4
    4607
    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.
    • K
      kicking_potato88 last edited by

      Hi, is it possible to plot the chart as a candlestick/bar chart instead of a line chart?

      Another question, I am trying to incorporate economic events/data into Backtrader. Any suggestions on how to feed the events into Backtrader, and is it possible to highlight bars where major data has been released? Thanks!

      Syed Javed Gardezi 1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators last edited by

        There are some tens of samples plotting candlesticks and/or bars.

        Check here for the option style when plotting: Docs - Plotting

        You can extend a data feed to have extra data Docs - Extending a Data Feed which can be the P/E ratio like in that case or anything you like.

        To Plot the events the best options would be:

        • Creating an Indicator that only delivers a point when an economic event happens. Assign the high or the low and plot and arrow/triangle or other marker

        • The same but with an Observer. In this blog post, the triangles of the BuySell observer are changed to arrows Blog - Arrows for the BuySell Observer

          Your best option is to check the source for the BuySell observer or the Trades observer and plot the economic events instead of the operations/trades.

        1 Reply Last reply Reply Quote 1
        • Syed Javed Gardezi
          Syed Javed Gardezi @kicking_potato88 last edited by

          @kicking_potato88 hi did you find a good solution yet for plotting economic news events into Backtrader. I am trying to do the same.

          P 1 Reply Last reply Reply Quote 0
          • P
            pikolo999 @Syed Javed Gardezi last edited by

            Could someone please share the example code of plotting economic events? @kicking_potato88 @Syed-Javed-Gardezi @backtrader

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