Package com.strategyquant.datalib
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
ConstructorsConstructorDescriptionInstantiates 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 TypeMethodDescriptionvoid
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
-
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
Instantiates a new data series.- Parameters:
name
- the nameallocationSize
- the allocation size
-
DataSeries
Instantiates a new data series.- Parameters:
name
- DataSeries nameallocationSize
- the allocation sizechartDef
- chart definition of the DataSeries
-
DataSeries
public DataSeries(int allocationSize, int growStep)Instantiates a new data series.- Parameters:
allocationSize
- the allocation sizegrowStep
- the grow step
-
DataSeries
Instantiates a new data series.- Parameters:
name
- the name
-
-
Method Details
-
chartHashCode
public int chartHashCode()Chart hash code.- Returns:
- the int
-
get
Gets the.- Parameters:
index
- the index- Returns:
- the double
- Throws:
TradingException
- the trading exception
-
getRounded
Gets the rounded.- Parameters:
index
- the index- Returns:
- the rounded
- Throws:
TradingException
- the trading exception
-
getRounded
Gets the rounded.- Parameters:
index
- the indexdecimals
- the decimals- Returns:
- the rounded
- Throws:
TradingException
- the trading exception
-
set
Sets the.- Parameters:
index
- the indexvalue
- the value- Throws:
TradingException
- the trading exception
-
set
Sets the.- Parameters:
index
- the indexvalue
- the valueexistingBar
- the existing bar- Throws:
TradingException
- the trading exception
-
set
Sets the.- Parameters:
value
- the value- Throws:
TradingException
- the trading exception
-
addValues
Adds the values.- Parameters:
valuesToAdd
- the values to add- Throws:
TradingException
- the trading exception
-
add
Adds the.- Parameters:
fillValue
- the fill value- Throws:
TradingException
- the trading exception
-