Gets a list of the currently open positions for a given symbol.

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

Syntax

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

Parameters

symbol
Type: RightEdge.Common..::..Symbol
A symbol to retrieve the open positions for.

Return Value

Type: IList<(Of <(<'Position>)>)>
A list of open positions for the specified symbol.

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 for this symbol
    IList<Position> openPositions = PositionManager.GetOpenPositions(symbol);

    // 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 for this symbol 
    Dim openPositions As IList(Of Position) = PositionManager.GetOpenPositions(symbol) 

    ' 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