One of the design goals was to quit as early as possible and let the users have full transparency of what was happening with errors. With the goal to force oneself to have code that would break on exceptions and forced revisiting the affected part.
But the time has come and some exceptions may slowly get added to the platform.
The base class for all exceptions is
BacktraderError (which is a direct
Inside the module
errorswhich can be reached as in for example:
import backtrader as bt class Strategy(bt.Strategy): def __init__(self): if something_goes_wrong(): raise bt.errors.StrategySkipError
import backtrader as bt class Strategy(bt.Strategy): def __init__(self): if something_goes_wrong(): raise bt.StrategySkipError
Requests the platform to skip this strategy for backtesting. To be raised
during the initialization (
__init__) phase of the instance