Click or drag to resize

Position

For the position calculation it is necessary to use the IPositionManager interface implementation, by way of PositionManager.

Prerequisites

The position calculation adding to the SampleSMA

  1. You should add the text box for the current position display in the information output window:

    C#
    <Label Grid.Column="0" Grid.Row="5" Content="Pos:" />
    <Label x:Name="Position" Grid.Column="1" Grid.Row="5" />
  2. Next, you need to extend the event method-handler of the strategy parameter change:

    C#
    this.Sync(() =>
    {
        Status.Content = _strategy.ProcessState;
        PnL.Content = _strategy.PnLManager.PnL;
        Slippage.Content = _strategy.SlippageManager.Slippage;
        Position.Content = _strategy.PositionManager.Position;
    });
Next Steps