self.is_backtesting#

property Strategy.is_backtesting#

Returns True if the strategy is running in backtesting mode.

Returns:

is_backtesting – True if the strategy is running in backtesting mode.

Return type:

bool

Example

>>> # Check if the strategy is running in backtesting mode
>>> if self.is_backtesting:
>>>     self.log_message("Running in backtesting mode")