Backtrader Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. nomnom
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
    N
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 3
    • Best 0
    • Controversial 1
    • Groups 0

    nomnom

    @nomnom

    -1
    Reputation
    359
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    nomnom Unfollow Follow

    Best posts made by nomnom

    • RE: Candlestick barup plotting color not working correctly?

      I don't know how accurate this is, but this ended up working:

      import backtrader as bt
      import pandas_datareader as web
      ...
      feed = web.DataReader("AAPL", "google", datetime(2016, 1, 1), datetime(2017, 1, 1))
      data = bt.feeds.PandasData(dataname=feed, name="AAPL")
      cerebro.adddata(data)
      cerebro.run()
      cerebro.plot(style='candlestick', barup='green', bardown='red')

      The graph looks as expected. Not sure if the data is exactly correct though.

      posted in General Code/Help
      N
      nomnom

    Latest posts made by nomnom

    • RE: Candlestick barup plotting color not working correctly?

      I don't know how accurate this is, but this ended up working:

      import backtrader as bt
      import pandas_datareader as web
      ...
      feed = web.DataReader("AAPL", "google", datetime(2016, 1, 1), datetime(2017, 1, 1))
      data = bt.feeds.PandasData(dataname=feed, name="AAPL")
      cerebro.adddata(data)
      cerebro.run()
      cerebro.plot(style='candlestick', barup='green', bardown='red')

      The graph looks as expected. Not sure if the data is exactly correct though.

      posted in General Code/Help
      N
      nomnom
    • RE: Candlestick barup plotting color not working correctly?

      Oh wow, thanks for the feedback. That post certainly has a lot of information. I'm a bit confused though, getting this data is an absolute critical part to be able to perform meaningful backtesting. How is everyone getting their data? Surely everyone isn't making one-off modifications, are they? I have to assume I'm being dumb here and there is a common source/service/method that everyone uses to get reliable, meaningful data.

      posted in General Code/Help
      N
      nomnom
    • Candlestick barup plotting color not working correctly?

      Hi everyone,

      I'm doing the most basic examples from the README page and simple tutorials online, and I'm plotting my graph the following way:

      cerebro.plot(style='candlestick')

      or

      cerebro.plot(style='candlestick', barup='green', bardown='red')

      However, my graph looks almost entirely red when plotted:

      0_1501308571777_Capture.PNG

      Verbatim copy/paste examples are showing the above type of output, but blog posts show red/green gray/green mixtures (as it should). Any thoughts on what is going wrong?

      I appreciate the help, thanks!

      posted in General Code/Help
      N
      nomnom