revalue_state#

API documentation for tradeexecutor.strategy.valuation.revalue_state Python function.

revalue_state(state, ts, valuation_model)[source]#

Revalue all open positions in the portfolio.

  • Write new valuations for all positions in the state

  • Reserves are not revalued.

Parameters:
  • ts (datetime) – Strategy timestamp pre-tick, or wall clock time.

  • valuation_model (Union[ValuationModel, Callable]) –

    Model that pulls out new values for positions.

    For legacy tests, this is a callable.

  • state (State) –