EasyLanguage Object Reference

PositionsProvider Class (Component)

The PositionsProvider allows access to updated information about positions held for specified symbols and order types from a list of TradeStation accounts. This information is similar to that found on the Positions tab of the TradeManager. The Position class describes the properties available for a specific position.

Typically, you will use the Toolbox to add a component to your EasyLanguage document.  Click and drag the name PositionsProvider into your document from the Toolbox.  By default, the name of the provider appears in the component tray at the bottom of your document followed by a number (to help identify multiple instances of the component).  

Open the Properties editor and locate the Accounts, Symbols, or Types properties under "Filters". By default, these fields are blank so all position objects will be available. A comma delimited list of account numbers, symbols, or types  (eg. "SIM12345, SIM67890") specifies that only those listed are to be included in the Positions collection queried by the PositionsProvider.  

To reference property values for a specific position object in EasyLanguage code, use PositionProvider1 followed by a 'dot operator', and the collection name: Position[parameter] followed by a 'dot operator' and the position property name. Parameter can be a numeric index (zero-based) that represents a Position object within the positions provider collection or a string containing a specific symbol and a string containing the AccountID.  Available positions properties will appear in the autocomplete list as soon as you type the 'dot' after position[parameter].  properties are also listed under Position class in the dictionary and help.

Value1=PositionsProvider1.Position[0].MarketValue;      // gets the actual market value for the first position [0] in the collection.

  The provider can only access positions that are associated with the current TradeStation logon.

For general information about providers, refer to Provider Classes.

Namespace: tsdata.trading

[ Expand All ]
Properties
  Name Type Description
Public property Accounts list A filter that lists specific accounts you want to query for positions. 
Public property Count int The number of available positions based on the filter criteria.
Public property Data object Object containing the available Positions based on the filter criteria.
Public property Position[index] object Gets the Position object for the specified index Position[N].
Public property Position[symbol,account] object Gets the Position object for the specified symbol name and account id strings.
Public property Symbols list Specifies the symbols filter list.
Public property Types list Specifies the position type filter list.  See PositionType for a list of possible values.
Methods
  Name Description
Public property Create Initializes a new instance of the PositionsProvider class.
Public property Contains(pos) True if the specified Position is contained in the provider..
Events
  Name Description
 Public event Updated Occurs whenever the PositionsProvider object is updated. See PositionUpdatedEventArgs for the properties returned by the handler's args parameters.
Example

The following RadarScreen example uses a PositionsProvider to display updated position information for any symbol row for which you have a position.  By default, this example shows positions from all accounts and for any type of position.  

Import Example

PositionsProvider indicator for RadarScreen

  1. Click on the Import Example link to import the example into TradeStation.   
  2. Go to the TradeStation platform and create a RadarScreen window containing symbols with positions.  Use the Insert - Indicator menu sequence and Add !ex_PosProvider to the RadarScreen window at the selected column location.
  3. To review or modify the example code, go to the TS Development Environment and open indicator!ex_PosProvider in the EasyLanguage Editor.
Inheritance Hierarchy

elsystem.Object

  elsystem.ElComponent

    tsdata.common.DataProvider

      tsdata.trading.PositionsProvider