Close position within OnPositionClosed event

Created at 06 Jun 2017, 18:33
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
obaum1@gmail.com's avatar

obaum1@gmail.com

Joined 06.06.2017

Close position within OnPositionClosed event
06 Jun 2017, 18:33


Hey Guys :)

I would like to close other positions inside OnPositionClosed event.
EXAMPLE:

protected override void OnPositionClosed(Position closedPosition)
{
       foreach (var p in Positions)
    {
       if(closedPosition.SymbolCode == p.SymbolCode)
       {
               CloseOldPosition(p.Id);
       }
    }
}

Would it be good practice?


@obaum1@gmail.com
Replies

Mikro
09 Jun 2017, 16:50

That's totaly dependent on your Trading Plan. Technicaly this is no Problem.


@Mikro