BacktestValuationModel#

tradeexecutor.backtest.backtest_valuation.BacktestValuationModel class.

class BacktestValuationModel[source]#

Bases: ValuationModel

Re-value assets based on their on-chain backtest dataset price.

__init__(pricing_model)[source]#
Parameters

pricing_model (BacktestSimplePricingModel) –

Methods

__init__(pricing_model)

__init__(pricing_model)[source]#
Parameters

pricing_model (BacktestSimplePricingModel) –

__call__(ts, position)[source]#
Parameters
  • ts (datetime) – When to revalue. Used in backesting. Live strategies may ignore.

  • position (TradingPosition) – Open position

Returns

(revaluation date, price) tuple. Note that revaluation date may differ from the wantead timestamp if there is no data available.

Return type

Tuple[datetime, USDollarAmount]