
Trying to use Backtrader for backtesting getting this error ...
Dec 13, 2024 · import yfinance as yf import pandas as pd import numpy as np import backtrader as bt from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection …
Newest 'backtrader' Questions - Stack Overflow
Hi i am having trouble importing backtrader and IbPy2. When i pip install both and when i run import backtrader in my python shell i get the following error: i pip installed these: pip install …
python - Getting data in Backtrader issue - Stack Overflow
Jul 2, 2021 · Since backtrader has a "old version" of yahoo.py on line 271 you need to add the headers. Once done works fine. It happens as well with pandas & pandas-datareader which …
matplotlib - Backtrader: AttributeError: 'RRuleLocator' object has …
Apr 2, 2023 · I had the exact same problem and my solution was to call the set_view_interval() method directly on the axis object associated with the RRuleLocator.
long and short strategy with macd indicator in Backtrader
Jan 5, 2022 · In your code you are showing the following: if self.data.MACD_hist[0]>0: if self.position.size<0 and self.data.MACD_hist[-1]<0 : self.close() self.log('CLOSE SHORT ...
How can I use my own strategy to test by backtrader?
Nov 17, 2024 · I try to backtest my strategy of trading that is named "AI reversal". Light-weight implementation is available in strategies and I checked the document of backtrader to be right. …
How to backtest portfolio compositions using backtrader?
Mar 30, 2021 · I have been looking at backtrader as a backtesting platform, however, the code I have seen in the repo mostly shows how to do stuff with indicators, like SMA cross over, RSI...
Backtrader throws attribute error on the data i have given
Oct 28, 2024 · def GetDataFromYahoo(ticker, start_date, end_date): # Fetch data from Yahoo Finance df = yf.download(ticker, start=start_date, end=end_date) # Check if the DataFrame is …
Backtrader plotting returns NaN or Inf error - Stack Overflow
Nov 9, 2024 · The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more.
Backtrader - IndexError: list index out of range - Stack Overflow
Mar 9, 2024 · I'm trying to load a custom data feed from a csv file that I've generated called "impact.csv" through the script below "backtrader_impact.py". However, at …