ValuationModel#
tradeexecutor.strategy.valuation.ValuationModel Python class in Trading Strategy framework.
- 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.
Used by EthereumPoolRevaluator model (which, in turn, is used by UniswapV2PoolRevaluator and UniswapV3PoolRevaluator)
- __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:
- __init__(*args, **kwargs)#