PositionOpenedEventArgs


Summary

Provides data for the position opening event.

Syntax

public class PositionOpenedEventArgs : Object

Members

NameTypeSummary
Position PropertyGets or sets the position being opened.

Example 1

public class SampleRobot : Robot
{
    protected override void OnStart()
    {
        Positions.Opened += Positions_Opened;
        ExecuteMarketOrder(TradeType.Buy, Symbol, 10000, "myLabel");         
    }
    private void Positions_Opened(PositionOpenedEventArgs args)
    {
        var position = args.Position;
        if(position.Label == "myLabel")
            Print("Position opened by SampleRobot");
    }
    //...
}