Backtrader Community

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

    Posts made by Z

    • Where Should I Get Data From?

      I was using yfinance to collect my data, but the data is highly inaccurate. I would love to hear some suggestions on where to obtain accurate data from. I'm using Backtrader for backtesting only, so I shouldn't need to access new data every day. I think I'll only need to download a large amount of data once (maybe 25 years on all SP500 stocks).

      Thanks for any feedback!

      posted in General Code/Help
      Z
      Z
    • Accessing the Open and Close of a Trade

      Hey, I'm a noob. How do I access the Open Price and Close Price of a trade? For example:

      def notify_trade(self, trade)
           when a new trade is opened (trade.justopened???):
                print(trade open price)
                print(trade close price)
      

      I looked at the Trade section of the documentation, but didn't find any attribute for the Trade Open Price and Trade Close Price, but maybe I'm just blind or something.

      Thanks much!

      posted in General Code/Help
      Z
      Z
    • 1 / 1