PositionStopActivateEvent

PositionStopActivateEvent
public event Action<Position> PositionStopActivateEvent;

The PositionStopActivateEvent is triggered at the moment the stop order for a position is activated.

It can be used for various scenarios, such as cancelling related orders, creating reverse strategies, and others.

Imagine that in the robot there is a function that opens a position according to certain rules. Now we want to add a stop-loss to positions, which, upon activation, will open a position in the opposite direction.

1. Subscribe to the candle update event, within whose handler the first position is opened.

2. Set a handler for the event of successful position opening.

3. Set a handler for the event of the position's stop-loss activation.

4. Calculate and set the stop-loss for the position.

5. Upon stop activation, open a position in the opposite direction.

If you have any difficulties or questions, please write to the support chat. Link