HS
    
        
            Mistake in example
            
                 03 May 2021, 10:41
            
                    
I am a beginner and tried the example. 
protected override void OnStart()
{
    Positions.Closed += PositionsClosed;
}
private void PositionsOnClosed(PositionClosedEventArgs args)
{
    var position = args.Position;
    Print("Position closed with {0} profit", position.GrossProfit);
}
It didn't work because
PositionsClosed is a wrong reference to PositionsOnClosed.

amusleh
04 May 2021, 11:06
Hi,
Your event handler and method name doesn't match, here is the working code:
Please check API references for more examples.
You have to learn at least C# basics before starting to write C# code.
@amusleh