ValuationModel#

tradeexecutor.strategy.valuation.ValuationModel class.

class ValuationModel[source]#

Bases: Protocol

Revalue a current position.

TODO: See if this should be moved inside state module, as it is referred by state.revalue_positions.

__init__(*args, **kwargs)#

Methods

__init__(*args, **kwargs)

__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]

__init__(*args, **kwargs)#