tradingstrategy-ai / trade-executor

A Python framework for managing positions and trades in DeFi
https://tradingstrategy.ai
Other
101 stars 28 forks source link

Executor crashed in live trading #975

Closed hieuh25 closed 3 months ago

hieuh25 commented 3 months ago

1 executor crashed in live trading when calculating indicators:

packages/futureproof/task_manager.py", line 183, in _wait_for_result
    self._raise(completed_task.result)
  File "/usr/local/lib/python3.10/site-packages/futureproof/task_manager.py", line 198, in _raise
    raise exception
  File "/usr/local/lib/python3.10/site-packages/futureproof/task_manager.py", line 157, in _on_complete
    complete_task.result = future.result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
tradeexecutor.strategy.pandas_trader.indicator.IndicatorCalculationFailed: Could not calculate indicator regime (<function regime at 0x7f73d9c21870>) for parameters {'length': 30, 'regime_threshold': 0}, candles is 91 rows, Index(['timestamp', 'open', 'high', 'low', 'close', 'volume', 'exchange_rate',
       'buys', 'sells', 'buy_volume', 'sell_volume', 'pair_id', 'start_block',
       'end_block', 'avg'],
      dtype='object') columns
The original exception was: <IndicatorKey adx_817584ff(length=30)-WBTC-USDC>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/trade-executor/tradeexecutor/cli/commands/start.py", line 500, in start
    loop.run_with_state(state)
  File "/usr/src/trade-executor/tradeexecutor/cli/loop.py", line 1375, in run_with_state
    return self.run_live(state)
  File "/usr/src/trade-executor/tradeexecutor/cli/loop.py", line 1275, in run_live
    raise LiveSchedulingTaskFailed("trade-executor closed because one of the scheduled tasks failed") from crash_exception
tradeexecutor.cli.loop.LiveSchedulingTaskFailed: trade-executor closed because one of the scheduled tasks failed