Gets a list of the currently open positions for a given symbol.
Namespace:
RightEdge.CommonAssembly: Common (in Common.dll) Version: 2010.1.0.0 (2010.1.0.0)
Syntax
| C# |
|---|
public IList<Position> GetOpenPositions( Symbol symbol ) |
| Visual Basic (Declaration) |
|---|
Public Function GetOpenPositions ( _ symbol As Symbol _ ) As IList(Of Position) |
| Visual C++ |
|---|
public: IList<Position^>^ GetOpenPositions( Symbol^ symbol ) |
Parameters
- symbol
- Type: RightEdge.Common..::.Symbol
A symbol to retrieve the open positions for.
Return Value
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.
CopyC#
CopyVisual Basic.Net
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 } }
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