Skip to content

PositionOpenedEventArgs

Summary

Provides data for the position opening event.

Signature

1
public class PositionOpenedEventArgs

Namespace

cAlgo.API

Properties

Name Description
Position { get; } Gets or sets the position being opened.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 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");
     }
     //...
 }

See Also


Last update: July 1, 2022

Comments