EasyLanguage Object Reference

AccountsProvider Class (Component)

The AccountsProvider allows access to account information from one or more TradeStation accounts that are associated with the provider.  This information is similar to that found on the Balances tab of the TradeManager.  The Account class describes the properties available for a specific account.

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

Open the Properties editor and locate the Accounts property under "Filters". A blank (default) Accounts filter property specifies that all of your active TradeStation accounts are to be included in the collection. Assigning a comma delimited list of account numbers to the Accounts filter property (i.e. "SIM12345, SIM67890") specifies that only those listed accounts are to be a part of the Accounts collection queried by the AccountsProvider.  

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

Value1=AccountsProvider1.Account[0].RTAccountNetWorth;      // gets the Real-Time Net Worth of first account [0] in the collection.

or

Value1=AccountsProvider1.Account["SIM12345"].BDCashBalance;   // gets the Beginning Day Cash Balance of a specific account number.

  The provider can only access accounts that are associated with the current TradeStation logon and those that are indicated by the Accounts filter.

For general information about providers, refer to Provider Classes.

Namespace: tsdata.trading

[ Expand All ]
Properties

   Additional properties, methods, and events are described in the classes listed under Inheritance Hierarchy (see below).

  Name Type Description
Public property Account[index] object Gets the Account object with the specified index.
Public property Account[accountID] object Gets the Account object based on the specified AccountID string.
Public property Accounts list A filter that lists specific accounts you want to query.  All accounts are queried if the filter is blank.
Public property Count integer Gets the total number of accounts in the provider's collection.
Public property Data object References the Accounts collection object.
Methods
  Name Description
Public property Contains (string) True if the specified AccountID string is contained in the provider.
Public property Create Initializes a new instance of AccountsProvider.
Events
  Name Description
 Public event Updated Occurs whenever an Account value is updated.  See AccountUpdatedEventArgs for the properties returned by the handler's args parameter.
Example

The following RadarScreen example uses an AccountsProvider to display the real-time accumulated net worth for your accounts.  

Import Example

AccountsProvider 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.  Use the Insert - Indicator menu sequence and Add !ex_AcctProvider 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_AcctProvider in the EasyLanguage Editor.
Inheritance Hierarchy

elsystem.Object

  elsystem.ElComponent

    tsdata.common.DataProvider

      tsdata.trading.AccountsProvider