com.dukascopy.api.indicators
Class IndicatorInfo

java.lang.Object
  extended by com.dukascopy.api.indicators.IndicatorInfo

public class IndicatorInfo
extends java.lang.Object

Describes indicator


Constructor Summary
IndicatorInfo()
          Creates IndicatorInfo without filling any fields
IndicatorInfo(java.lang.String name, java.lang.String title, java.lang.String groupName, boolean overChart, boolean overVolumes, boolean unstablePeriod, boolean candlesticks, int numberOfInputs, int numberOfOptionalInputs, int numberOfOutputs)
          Deprecated. all "candlesticks" indicators are just "overChart" indicators with specific output type
IndicatorInfo(java.lang.String name, java.lang.String title, java.lang.String groupName, boolean overChart, boolean overVolumes, boolean unstablePeriod, int numberOfInputs, int numberOfOptionalInputs, int numberOfOutputs)
          Creates IndicatorInfo and fills all fields
 
Method Summary
 java.lang.String getGroupName()
          Returns name of the group
 java.lang.String getName()
          Returns name of the indicator.
 int getNumberOfInputs()
          Returns number of inputs, that should be provided before calling function
 int getNumberOfOptionalInputs()
          Returns number of optional inputs, that can be set to customize function
 int getNumberOfOutputs()
          Returns number of indicator outputs.
 java.lang.String getTitle()
          Returns title of the indicator
 boolean isCandlesticks()
          Deprecated. always returns false
 boolean isDataTypeSupported(DataType dataType)
          Checks whether the data type is supported by the indicator
 boolean isOverChart()
          Returns true if indicator should be drawn over chart
 boolean isOverVolumes()
          Returns true if indicator should be shown over volumes
 boolean isRecalculateAll()
          Returns true if indicator should be recalculated for all chart data
 boolean isRecalculateOnNewCandleOnly()
          Returns true if indicator gets calculated only once for every newly arriving candle as opposed to every arriving tick
 boolean isShowOnTicks()
          Deprecated. replaced by isDataTypeSupported(DataType)
 boolean isSparceIndicator()
          Deprecated. As of API ver. 2.6.45 replaced by isSparseIndicator()
 boolean isSparseIndicator()
           
 boolean isUnstablePeriod()
          Returns true if indicator has unstable period (like EMA or SAR).
 void setCandlesticks(boolean candlesticks)
          Deprecated. if true, then makes indicator "overChart"
 void setGroupName(java.lang.String groupName)
          Sets name of the group
 void setName(java.lang.String name)
          Sets name of the indicator.
 void setNumberOfInputs(int numberOfInputs)
          Sets number of inputs
 void setNumberOfOptionalInputs(int numberOfOptionalInputs)
          Sets number of optional inputs
 void setNumberOfOutputs(int numberOfOutputs)
          Sets number of outputs, that indicator will return
 void setOverChart(boolean overChart)
          Sets flag that defines where indicator should be drawn
 void setOverVolumes(boolean overVolumes)
          Sets flag that defines where indicator should be drawn
 void setRecalculateAll(boolean recalculateAll)
          If set to true, then indicator will be recalculated for all chart data, instead of calculating it only for new arriving candle
 void setRecalculateOnNewCandleOnly(boolean recalculateOnNewCandleOnly)
          Set to true if indicator should get calculated only once for every newly arriving candle
 void setShowOnTicks(boolean showOnTicks)
          Deprecated. replaced by setSupportedDataTypes(DataType... dataTypes)
 void setSparceIndicator(boolean sparceIndicator)
          Deprecated. As of API ver. 2.6.45 replaced by setSparseIndicator(boolean)
 void setSparseIndicator(boolean sparseIndicator)
          Set this flag to true if indicator doesn't draw values for every candle, e.g. the ZigZag indicator.
 void setSupportedDataTypes(DataType... dataTypes)
          Sets the data types supported by the indicator
 void setTitle(java.lang.String title)
          Sets title of the indicator
 void setUnstablePeriod(boolean unstablePeriod)
          Sets flag that defines if indicator has unstable period
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndicatorInfo

public IndicatorInfo()
Creates IndicatorInfo without filling any fields


IndicatorInfo

public IndicatorInfo(java.lang.String name,
                     java.lang.String title,
                     java.lang.String groupName,
                     boolean overChart,
                     boolean overVolumes,
                     boolean unstablePeriod,
                     boolean candlesticks,
                     int numberOfInputs,
                     int numberOfOptionalInputs,
                     int numberOfOutputs)
Deprecated. all "candlesticks" indicators are just "overChart" indicators with specific output type

Creates IndicatorInfo and fills all fields

Parameters:
name - name of the indicator. Should be something simple like SMA for Simple Moving Average or BBANDS for Bollinger Bands
title - title of the indicator
groupName - name of the indicator group
overChart - true if indicator should be drawn over candles/ticks
overVolumes - true if indicator should be drawn over volume information
unstablePeriod - true if indicator has unstable period (like EMA or SAR). This will add more candles in every call to stabilize function
candlesticks - true if indicator is Pattern Recognition function and should be shown over bars
numberOfInputs - number of inputs that user should provide
numberOfOptionalInputs - number of optional inputs
numberOfOutputs - number of outputs, that function returns

IndicatorInfo

public IndicatorInfo(java.lang.String name,
                     java.lang.String title,
                     java.lang.String groupName,
                     boolean overChart,
                     boolean overVolumes,
                     boolean unstablePeriod,
                     int numberOfInputs,
                     int numberOfOptionalInputs,
                     int numberOfOutputs)
Creates IndicatorInfo and fills all fields

Parameters:
name - name of the indicator. Should be something simple like SMA for Simple Moving Average or BBANDS for Bollinger Bands
title - title of the indicator
groupName - name of the indicator group
overChart - true if indicator should be drawn over candles/ticks
overVolumes - true if indicator should be drawn over volume information
unstablePeriod - true if indicator has unstable period (like EMA or SAR). This will add more candles in every call to stabilize function
numberOfInputs - number of inputs that user should provide
numberOfOptionalInputs - number of optional inputs
numberOfOutputs - number of outputs, that function returns
Method Detail

getName

public java.lang.String getName()
Returns name of the indicator. Should be something simple like SMA for Simple Moving Average or BBANDS for Bollinger Bands

Returns:
name of the indicator

setName

public void setName(java.lang.String name)
Sets name of the indicator. Should be something simple like SMA for Simple Moving Average or BBANDS for Bollinger Bands

Parameters:
name - name of the indicator

getTitle

public java.lang.String getTitle()
Returns title of the indicator

Returns:
title of the indicator

setTitle

public void setTitle(java.lang.String title)
Sets title of the indicator

Parameters:
title - title of the indicator

getGroupName

public java.lang.String getGroupName()
Returns name of the group

Returns:
name of the group

setGroupName

public void setGroupName(java.lang.String groupName)
Sets name of the group

Parameters:
groupName - name of the group

isOverChart

public boolean isOverChart()
Returns true if indicator should be drawn over chart

Returns:
true if indicator should be drawn over chart

setOverChart

public void setOverChart(boolean overChart)
Sets flag that defines where indicator should be drawn

Parameters:
overChart - true if indicator should be drawn over chart

isOverVolumes

public boolean isOverVolumes()
Returns true if indicator should be shown over volumes

Returns:
true if indicator should be shown over volumes

setOverVolumes

public void setOverVolumes(boolean overVolumes)
Sets flag that defines where indicator should be drawn

Parameters:
overVolumes - true if indicator should be shown over volumes

isUnstablePeriod

public boolean isUnstablePeriod()
Returns true if indicator has unstable period (like EMA or SAR). This will add more candles in every call to stabilize function

Returns:
true if indicator has unstable period

setUnstablePeriod

public void setUnstablePeriod(boolean unstablePeriod)
Sets flag that defines if indicator has unstable period

Parameters:
unstablePeriod - true if indicator has unstable period

isCandlesticks

public boolean isCandlesticks()
Deprecated. always returns false


setCandlesticks

public void setCandlesticks(boolean candlesticks)
Deprecated. if true, then makes indicator "overChart"


getNumberOfInputs

public int getNumberOfInputs()
Returns number of inputs, that should be provided before calling function

Returns:
number of inputs

setNumberOfInputs

public void setNumberOfInputs(int numberOfInputs)
Sets number of inputs

Parameters:
numberOfInputs - number of inputs

getNumberOfOptionalInputs

public int getNumberOfOptionalInputs()
Returns number of optional inputs, that can be set to customize function

Returns:
number of optional inputs

setNumberOfOptionalInputs

public void setNumberOfOptionalInputs(int numberOfOptionalInputs)
Sets number of optional inputs

Parameters:
numberOfOptionalInputs - number of optional inputs

getNumberOfOutputs

public int getNumberOfOutputs()
Returns number of indicator outputs. Usually every output represents one line

Returns:
number of outputs

setNumberOfOutputs

public void setNumberOfOutputs(int numberOfOutputs)
Sets number of outputs, that indicator will return

Parameters:
numberOfOutputs - number of outputs

isShowOnTicks

public boolean isShowOnTicks()
Deprecated. replaced by isDataTypeSupported(DataType)


setShowOnTicks

public void setShowOnTicks(boolean showOnTicks)
Deprecated. replaced by setSupportedDataTypes(DataType... dataTypes)


isRecalculateAll

public boolean isRecalculateAll()
Returns true if indicator should be recalculated for all chart data

Returns:
true if indicator should be recalculated for all chart data

setRecalculateAll

public void setRecalculateAll(boolean recalculateAll)
If set to true, then indicator will be recalculated for all chart data, instead of calculating it only for new arriving candle

Parameters:
recalculateAll -

isSparceIndicator

public boolean isSparceIndicator()
Deprecated. As of API ver. 2.6.45 replaced by isSparseIndicator()


setSparceIndicator

public void setSparceIndicator(boolean sparceIndicator)
Deprecated. As of API ver. 2.6.45 replaced by setSparseIndicator(boolean)


isSparseIndicator

public boolean isSparseIndicator()
Returns:
true if the indicator is a "sparse indicator" which doesn't generate values for every candle, false otherwise

setSparseIndicator

public void setSparseIndicator(boolean sparseIndicator)
Set this flag to true if indicator doesn't draw values for every candle, e.g. the ZigZag indicator. This will force drawing on more data than is visible on the screen making it slower but with correct lines that go beyond the chart edge.

Parameters:
sparseIndicator - draw indicator on more data than is visible on the screen

isRecalculateOnNewCandleOnly

public boolean isRecalculateOnNewCandleOnly()
Returns true if indicator gets calculated only once for every newly arriving candle as opposed to every arriving tick

Returns:
true if indicator gets calculated only once for every newly arriving candle as opposed to every arriving tick

setRecalculateOnNewCandleOnly

public void setRecalculateOnNewCandleOnly(boolean recalculateOnNewCandleOnly)
Set to true if indicator should get calculated only once for every newly arriving candle

Parameters:
recalculateOnNewCandleOnly - calculate indicator only once for every newly arriving candle

setSupportedDataTypes

public void setSupportedDataTypes(DataType... dataTypes)
Sets the data types supported by the indicator

Parameters:
dataTypes - data types supported by the indicator

isDataTypeSupported

public boolean isDataTypeSupported(DataType dataType)
Checks whether the data type is supported by the indicator

Parameters:
dataType - data type to check
Returns:
true if data type is supported by the indicator, false otherwise