AutoTrader icon indicating copy to clipboard operation
AutoTrader copied to clipboard

Yahoo finance support is broken, or do we need a particular version of yfinance lib?

Open trivalent opened this issue 11 months ago • 2 comments

Running a simple code with the following code results in a failure:

at = AutoTrader()
at.configure(verbosity=1, show_plot=True, feed="yahoo")
at.add_strategy("ema_crossover")
at.backtest(start_dt=datetime.now() - timedelta(days=190), end_dt=datetime.now())
at.virtual_account_config(initial_balance=100000, leverage=1)
at.run()

File "E:\workspace\python\AutoTrader\autotrader\autotrader.py", line 1468, in _main bot = AutoTraderBot( File "E:\workspace\python\AutoTrader\autotrader\autobot.py", line 203, in init my_strat.create_plotting_indicators(data) File "E:\workspace\python\AutoTrader\strategies\ema_crossover.py", line 31, in create_plotting_indicators "data": TA.EMA(data, self.parameters["fast_ema"]), File "C:\Users\rahul\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\finta\finta.py", line 15, in wrap args[i] = args[i].rename(columns={c: c.lower() for c in args[i].columns}) File "C:\Users\rahul\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\finta\finta.py", line 15, in args[i] = args[i].rename(columns={c: c.lower() for c in args[i].columns}) AttributeError: 'tuple' object has no attribute 'lower'

yfinance version: yfinance-0.2.50 AutoTrader version: latest/main branch.

trivalent avatar Nov 25 '24 17:11 trivalent