Interface DataContext


public interface DataContext
This context provides an access point to services relating to data.
  • Method Details

    • getDataSeries

      DataSeries getDataSeries()
      Gets the primary data series.
      Returns:
      primary data series for this study.
    • getChartBarSize

      BarSize getChartBarSize()
      Gets the current bar size for the underlying chart.
      Returns:
      the current bar size for the underlying chart
    • getDataSeries

      DataSeries getDataSeries(BarSize barSize)
      Gets additional data series objects of a different bar size.
      Parameters:
      barSize - barSize for the data series
      Returns:
      data series of the given bar size.
    • getInstrument

      Instrument getInstrument()
      Gets the instrument associated with this context.
      Returns:
      instrument associated with this context.
    • getInstruments

      List<Instrument> getInstruments()
      Gets the instruments associated with this context.
      Returns:
      instruments associated with this context.
    • signal

      void signal(int index, Object signalKey, String message, Object value)
      Triggers a signal with the given key, message and value. Note: An actual signal is only triggered if signals have been configured.
      Parameters:
      index - index of the bar that triggered this signal. Note: signals are only fired for the current bar when it is completed
      signalKey - event name of the alert (displayed to user)
      message - describes the signal (dislayed to the user, if an alert)
      value - value that triggered the alert (displayed to user)
    • isSignalEnabled

      boolean isSignalEnabled(Object signalKey)
      Checks to see if the signal with the given key is enabled.
      Parameters:
      signalKey - unique key that identifies the signal.
      Returns:
      true if the signal is enabled
    • isRTH

      boolean isRTH()
      Returns true if the historical data is regular trading hours (vs extended hours).
      Returns:
      true if this is regular trading hours (rth).
    • getCurrentTime

      long getCurrentTime()
      Gets the current time. This is the time synchronized with the Broker/Data Service (if supported by the underlying service).
      Returns:
      current time (synchronized with the broker/data service)
    • getTimeZone

      TimeZone getTimeZone()
      Gets the time zone for the underlying chart.
      Returns:
      time zone set for the underlying chart
    • getDefaults

      Defaults getDefaults()
      Defaults defined by the system.
      Returns:
      system defaults
    • isLoadingData

      boolean isLoadingData()
      Checks to see if the system is currently loading historical data.
      Returns:
      true if the system is currently loading data.