You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm seeing this error stacktrace when killing a lumibot process via the keyboard interrupt.
^C2024-03-22 22:40:13,741: asyncio: INFO: [MyStrategy] Executing the on_abrupt_closing event method
Breaking loop because should not continue.
Traceback (most recent call last):
File "/Users/sean/workspace/trading_bot_test/./executeStrategies.py", line 43, in <module>
trader.run_all()
File "/usr/local/lib/python3.11/site-packages/lumibot/traders/trader.py", line 117, in run_all
self._join_pool()
File "/usr/local/lib/python3.11/site-packages/lumibot/traders/trader.py", line 197, in _join_pool
strategy_thread.join()
File "/usr/local/lib/python3.11/site-packages/lumibot/strategies/strategy_executor.py", line 245, in join
super(StrategyExecutor, self).join(timeout)
File "/usr/local/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1112, in join
self._wait_for_tstate_lock()
File "/usr/local/Cellar/[email protected]/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1132, in _wait_for_tstate_lock
if lock.acquire(block, timeout):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/lumibot/traders/trader.py", line 207, in _stop_pool
strategy_thread.stop()
File "/usr/local/lib/python3.11/site-packages/lumibot/strategies/strategy_executor.py", line 242, in stop
self._on_abrupt_closing(KeyboardInterrupt())
File "/usr/local/lib/python3.11/site-packages/lumibot/strategies/strategy_executor.py", line 438, in _on_abrupt_closing
self.strategy._dump_stats()
File "/usr/local/lib/python3.11/site-packages/lumibot/strategies/_strategy.py", line 572, in _dump_stats
if self._backtesting_start is not None and self._backtesting_end is not None:
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'MyStrategy' object has no attribute '_backtesting_start'. Did you mean: 'backtesting_start'?
The text was updated successfully, but these errors were encountered:
Are you backtesting the strategy or live/paper trading? If backtesting did you set a start time one way or another? It looks to me as though _Strategy._dump_stats will fail this way when not backtesting because _backtesting_start is only set when _is_backtesting is True.
Fix Issue #406 which is due to trying to access _backtesting_start when not backtesting.
Also move that big chunk of code into its own method so we can see what's going on.
Hi there,
I'm seeing this error stacktrace when killing a lumibot process via the keyboard interrupt.
The text was updated successfully, but these errors were encountered: