check_position_triggers#
API documentation for tradeexecutor.strategy.stop_loss.check_position_triggers Python function.
- check_position_triggers(position_manager, execution_context)[source]#
Generate trades that depend on real-time price signals.
Stop loss
Take profit
Any trade.triggers like market limit
What does this do:
Get the real-time price of an assets that are currently hold in the portfolio
Update dynamic stop loss/take profits like trailing stop loss
Use mid-price to check for the trigger price threshold
Generate stop loss/take profit signals for trades
See related position attributes
tradeexecutor.state.position.TradingPosition.trailing_stop_loss
- Parameters:
position_manager (PositionManager) – Encapsulates the current state, universe for closing positions
epsilon – The rounding error to zero
execution_context (ExecutionContext) –
- Returns:
List of triggered trades for all positions, like market sell on a stop loss triggered.
- Return type: