PriceSeriesProvider Class (Component)

The PriceSeriesProvider allows access to current and historical price values from a PriceSeries collection for a specified Symbol.  The Updated event is called whenever a change occurs in the referenced data.  

Indexed values in a PriceSeries are equivalent to bar values in Chart or gird row based on a specified symbol, interval, and bar range where the index represents 'bars ago'.

Typically, you will use the Toolbox to add a component to your EasyLanguage document.  Click and drag the name PriceSeriesProvider 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 Symbol property and the Interval and Range group of properties under "Filters". The entries in any or all of these fields determines the data that is included in the price series collection for a specified symbol. By default, the interval is set to 5 min bars with a range of 1 bar back.  

To reference property values from a price series in EasyLanguage code, use PriceSeriesName followed by a 'dot operator' and the property name.  Use a 'barsago' index in square brackets ( e.g. myPrices.High[4] ) to access values from indexed properties. Available price series properties will appear in the Autocomplete list as soon as you type the 'dot' after PriceSeriesName.  Refer to the property descriptions below or in the EasyLanguage dictionary for more information about each property.

Value1 = PriceSeriesProvider1.Close[1];      // gets the Close of 1 bar ago from the specified price series provider.  

For general information about providers, refer to Provider Classes.

Namespace: tsdata.marketdata

Properties

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

  Name Type Description
Public property Close[index] double Gets the closing price of the bar interval with the specified index.
Public property Count int Gets the number of available historical bar intervals in the price series.
Public property Data[index] object Gets a specified PriceSeries object based on the index.
Public property High[index] double Gets the high price of the bar interval with the specified index.
Public property IncludeTicksInfo bool True to include Ticks, TicksDown, TicksUnchanged, and TicksUp in the price series.
Public property IncludeVolumeInfo bool True to include Volume, VolumeDown, VolumeUnchanged, and VolumeUp in the price series.
Public property Interval object Sets and gets the DataInterval values for the price bars.
Public property LastBarIsClosed bool True when the last bar is closed and next bar not yet opened.
Public property LastBarIsOpen bool True when the last bar is open and active.
Public property LastBarIsSessionClosed bool True when the session ended on the last bar.
Public property Low[index] double Gets the low price of the bar interval with the specified index.
Public property OpenInterest[index] double Gets the number of outstanding contracts for an option within the specified interval.
Public property Open[index] double Gets the opening price of the bar interval with the specified index.
Public property Range object Sets and gets the DataRange values for the price bars.
Public property SessionName string Sets and gets the name of the session.
Public property Symbol string Sets and gets the Symbol whose price bars are referenced.
Public property Ticks[index] double Gets the total number of trades within the specified bar interval.
Public property TicksDown[index] double Gets the number of trades where the price is down from the previous trade in a bar.
Public property TicksUp[index] double Gets the number of trades where the price is up from the previous trade in a bar.
Public property Time[index] datetime Gets the time stamp of the bar interval with the specified index.
Public property Volume[index] double Gets the total trade volume (shares/contracts) within the specified bar interval.
Public property VolumeDown[index] double Gets the trade volume where the price is down from the previous trade in a bar.
Public property VolumeUp[index] double Gets the trade volume where the price is up from the previous trade in a bar.
Events
  Name Description
 Public event Updated Occurs whenever the PriceSeriesProvider object is updated. See PriceSeriesUpdatedEventArgs for the properties returned by the handler's args parameter.
Methods
  Name Description
Public property Create() Initializes a new instance of the class.
Example

The following example uses a pair of PriceSeriesProviders to calculate and display the daily relative percent change between the current symbol (a row in RadarScreen) and a user specifiable reference symbols, such as SPY.   

Import Example

PriceSeriesProvider indicator for Chart Analysis and RadarScreen

  1. Click on the Import Example link to import the example into TradeStation.   
  2. Go to the TradeStation platform and create a Chart Analysis window or a RadarScreen window containing multiple symbols.  Use the Insert - Indicator menu sequence and add !ex_PriceSeriesProv to the window.
  3. To review or modify the example code, go to the TS Development Environment and open indicator!ex_PriceSeriesProv in the EasyLanguage Editor.