engine_version#

API documentation for tradeexecutor.strategy.engine_version Python module in Trading Strategy.

Module description#

Execution engine versioning.

Different strategy modules may have functions with different signatures. Versioning strategy modules allows us to add and remove arguments without breaking backwards compatibility.

To compare versions:

from packaging import version

engine_version = run_description.trading_strategy_engine_version
if engine_version:
    if version.parse(engine_version) >= version.parse("0.5"):
        parameters = run_description.runner.parameters
        assert "required_history_period" in parameters, f"Strategy lacks Parameters.required_history_period. We have {parameters}"