Gets a list of open positions for all symbols.

Namespace: RightEdge.Common
Assembly: Common (in Common.dll) Version: 2010.1.0.0 (2010.1.0.0)

Syntax

C#
public IList<Position> GetOpenPositions()
Visual Basic
Public Function GetOpenPositions As IList(Of Position)
Visual C++
public:
IList<Position^>^ GetOpenPositions()
F#
member GetOpenPositions : unit -> IList<Position> 

Return Value

Type: IList<(Of <(<'Position>)>)>
A list of the currently open positions

Remarks

This version of GetOpenPositions returns a list of open positions across all symbols.

Examples

The following code example demonstrates how to retrieve all open positions for the specified symbol.
C# Copy imageCopy
public override void NewSymbolBar(Symbol symbol, BarData bar)
{
    // Get all open positions regardless of symbol
    IList<Position> openPositions = PositionManager.GetOpenPositions();

    // Check to see if we have any open positions for this symbol.
    if (openPositions.Count > 0)
    {
        // Do desired actions when there are positions open
    }
}
Visual Basic.Net Copy imageCopy
Public Overloads Overrides Sub NewSymbolBar(ByVal symbol As Symbol, ByVal bar As BarData) 
    ' Get all open positions regardless of symbol 
    Dim openPositions As IList(Of Position) = PositionManager.GetOpenPositions() 

    ' Check to see if we have any open positions for this symbol.
    If openPositions.Count > 0 Then 
        ' Do specified actions when there are positions open
    End If 
End Sub

See Also