Gets a list of open positions for all symbols.
Namespace:
RightEdge.CommonAssembly: Common (in Common.dll) Version: 2010.1.0.0 (2010.1.0.0)
Syntax
| C# |
|---|
public IList<Position> GetOpenPositions() |
| Visual Basic (Declaration) |
|---|
Public Function GetOpenPositions As IList(Of Position) |
| Visual C++ |
|---|
public: IList<Position^>^ GetOpenPositions() |
Return Value
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.
CopyC#
CopyVisual Basic.Net
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 } }
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