Class DataSeries

java.lang.Object
com.strategyquant.datalib.dataseries.DataSeriesBase
com.strategyquant.datalib.DataSeries

public class DataSeries extends com.strategyquant.datalib.dataseries.DataSeriesBase
Special array object storing double values. Array is reversely indexed, DataSeries.get(0) returns very last value, DataSeries.get(1) returns value before that etc.
  • Field Summary

    Fields inherited from class com.strategyquant.datalib.dataseries.DataSeriesBase

    Log
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiates a new data series.
    DataSeries​(int allocationSize)
    Instantiates a new data series.
    DataSeries​(int allocationSize, int growStep)
    Instantiates a new data series.
    DataSeries​(String name)
    Instantiates a new data series.
    DataSeries​(String name, int allocationSize)
    Instantiates a new data series.
    DataSeries​(String name, int allocationSize, ChartDef chartDef)
    Instantiates a new data series.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add​(double fillValue)
    Adds the.
    void
    addValues​(int valuesToAdd)
    Adds the values.
    int
    Chart hash code.
    double
    get​(int index)
    Gets the.
    double
    getRounded​(int index)
    Gets the rounded.
    double
    getRounded​(int index, int decimals)
    Gets the rounded.
    void
    set​(double value)
    Sets the.
    void
    set​(int index, double value)
    Sets the.
    void
    set​(int index, double value, boolean existingBar)
    Sets the.

    Methods inherited from class com.strategyquant.datalib.dataseries.DataSeriesBase

    _getDouble, _writeDoubleToOffheapRealIndex, addChangeListener, addDoubleValues, addLongValues, callDataChangeListeners, destroy, getColor, getComputedUntilIndex, getIndyStartingBar, getInstrumentInfo, getLineName, getName, getShift, setColor, setComputedUntil, setDataComputer, setIndyStartingBar, setLineName, setName, setName, setShift, size, specialSize, Symbol, updateComputedUntil

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DataSeries

      public DataSeries()
      Instantiates a new data series.
    • DataSeries

      public DataSeries(int allocationSize)
      Instantiates a new data series.
      Parameters:
      allocationSize - the allocation size
    • DataSeries

      public DataSeries(String name, int allocationSize)
      Instantiates a new data series.
      Parameters:
      name - the name
      allocationSize - the allocation size
    • DataSeries

      public DataSeries(String name, int allocationSize, ChartDef chartDef)
      Instantiates a new data series.
      Parameters:
      name - DataSeries name
      allocationSize - the allocation size
      chartDef - chart definition of the DataSeries
    • DataSeries

      public DataSeries(int allocationSize, int growStep)
      Instantiates a new data series.
      Parameters:
      allocationSize - the allocation size
      growStep - the grow step
    • DataSeries

      public DataSeries(String name)
      Instantiates a new data series.
      Parameters:
      name - the name
  • Method Details

    • chartHashCode

      public int chartHashCode()
      Chart hash code.
      Returns:
      the int
    • get

      public double get(int index) throws TradingException
      Gets the.
      Parameters:
      index - the index
      Returns:
      the double
      Throws:
      TradingException - the trading exception
    • getRounded

      public double getRounded(int index) throws TradingException
      Gets the rounded.
      Parameters:
      index - the index
      Returns:
      the rounded
      Throws:
      TradingException - the trading exception
    • getRounded

      public double getRounded(int index, int decimals) throws TradingException
      Gets the rounded.
      Parameters:
      index - the index
      decimals - the decimals
      Returns:
      the rounded
      Throws:
      TradingException - the trading exception
    • set

      public void set(int index, double value) throws TradingException
      Sets the.
      Parameters:
      index - the index
      value - the value
      Throws:
      TradingException - the trading exception
    • set

      public void set(int index, double value, boolean existingBar) throws TradingException
      Sets the.
      Parameters:
      index - the index
      value - the value
      existingBar - the existing bar
      Throws:
      TradingException - the trading exception
    • set

      public void set(double value) throws TradingException
      Sets the.
      Parameters:
      value - the value
      Throws:
      TradingException - the trading exception
    • addValues

      public void addValues(int valuesToAdd) throws TradingException
      Adds the values.
      Parameters:
      valuesToAdd - the values to add
      Throws:
      TradingException - the trading exception
    • add

      public void add(double fillValue) throws TradingException
      Adds the.
      Parameters:
      fillValue - the fill value
      Throws:
      TradingException - the trading exception