DataProvider (Class)

Defines the structure for an object that opens or closes an asynchronous data path for provider classes.  

 

Forcing a DataProvider to Load Prior to Proceeding

If the code attempts to get data from a data provider, but the provider has not loaded (but has been set to load -> Load property set to true or LoadProvider() method called), the code will stop running and once the provider loads, the EasyLanguage code will rerun again.

This may be required in some cases like needing data in a PriceSeriesProvider to be available on CurrentBar 1 (the first bar the code runs on). For more information on forcing a PriceSeriesProvider to load so that bar data is on CurrentBar 1, see the help page for PriceSeriesProvider.

 

Namespace: tsdata.common

Properties

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

  Name Type Description
Public property Load bool True to open the connection to the data. If set to False, the connection to the data will be closed if the connection is already open.
Public property Realtime bool If set to True, the data provider will provide realtime data updates via an updated event handler. Updated event handlers are provided in each class that inherits this DataProvider class (e.g, OrdersProvider, PriceSeriesProvider, etc.). If set to False, realtime data updates will not be provided.
Public property State enum Gets the state of the data provider.  See DataState for a list of possible values.
Public property TimeZone enum Gets or sets the TimeZone of the data provider. Local = 0, Exchange = 1. See TimeZone for a list of values. Note that the DataProvider class uses the tsdata.common.TimeZone class for this property and not elsystem.TimeZone.
Methods
  Name Description
Public property CloseProvider Closes the connection to the data. Calling this method is similar to setting the Load property of the provider to False.
Public property LoadProvider Opens the connection to the data . Calling this method is similar to setting the Load property of the provider to True.
Events
  Name Description
Public event StateChanged Occurs whenever the state of the provider changes. See StateChangedEventArgs for the properties return by the handler's args parameter.