positions.set_exit_rules
Set stop-loss and take-profit price levels to automatically close positions when market prices reach specified thresholds.
Instructions
Set stop-loss and/or take-profit price levels on an open position. When the market price crosses these levels, check_exits will automatically close the position. Use get_positions to find trade IDs. Pro feature.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trade_id | Yes | ID of the open position to set exit rules on (from get_positions) | |
| stop_loss | No | Price at which to sell (stop-loss). E.g. 0.30 means sell if price drops to $0.30 | |
| take_profit | No | Price at which to sell (take-profit). E.g. 0.85 means sell if price rises to $0.85 |