OnPositionUpdate()

View as Markdown

Definition

Called every time a position changes state.

The OnPositionUpdate() method is called on ALL position updates (e.g., any account and instrument combination) and NOT just the specific items which are selected in the SuperDOM.

Method Return Value

This method does not return a value.

Syntax

protected override void OnPositionUpdate(PositionEventArgs positionUpdate)

Method Parameters

ParameterDescription
positionUpdateA PositionEventArgs representing the change in position

Examples

1protected override void OnPositionUpdate(PositionEventArgs positionUpdate)
2{
3 // Do not take action if the position update does not come from the selected SuperDOM instrument/account
4 if (positionUpdate.Position.Instrument != SuperDom.Instrument
5 || positionUpdate.Position.Account != SuperDom.Account)
6 return;
7
8 // Do something
9}