public class BWMFIIndicator extends Object implements IIndicator, IMinMax
Constructor and Description |
---|
BWMFIIndicator() |
Modifier and Type | Method and Description |
---|---|
IndicatorResult |
calculate(int startIndex,
int endIndex)
Calculates values of the indicator from startIndex to endIndex of input parameter and places them in output parameters
|
IndicatorInfo |
getIndicatorInfo()
Returns object that describes indicator, how many inputs, outputs it has, where it should be shown etc
|
InputParameterInfo |
getInputParameterInfo(int index)
Returns object that describes one of the inputs
|
int |
getLookback()
Returns number of elements needed to calculate value of the first element.
|
int |
getLookforward()
Returns number of elements after last element needed to calculate value of the last element.
|
double[] |
getMinMax(int outputIdx,
Object values,
int firstVisibleValueIndex,
int lastVisibleValueIndex)
This method will be called once for every output.
|
OptInputParameterInfo |
getOptInputParameterInfo(int index)
Returns object that describes optional input
|
OutputParameterInfo |
getOutputParameterInfo(int index)
Returns object that describes output
|
void |
onStart(IIndicatorContext context)
Called on indicator initialization
|
void |
setInputParameter(int index,
Object array)
Sets input parameter.
|
void |
setOptInputParameter(int index,
Object value)
Sets optional input parameter.
|
void |
setOutputParameter(int index,
Object array)
Sets output parameter.
|
public void onStart(IIndicatorContext context)
IIndicator
onStart
in interface IIndicator
context
- allows access to system functionalitypublic IndicatorResult calculate(int startIndex, int endIndex)
IIndicator
calculate
in interface IIndicator
startIndex
- index of the first element in input parameters that needs corresponding indicator value. That doesn't mean that values
before startIndex will not be read, they will be if lookback is more than 0. That also doesn't mean that value for startIndex will be
calculated, it will be not if startIndex < lookback. IndicatorResult.getFirstValueIndex()
returns index of the first element that
has corresponding calculated value in output array(s)endIndex
- index of the last element in input parameters that needs corresponding indicator valuepublic IndicatorInfo getIndicatorInfo()
IIndicator
getIndicatorInfo
in interface IIndicator
public InputParameterInfo getInputParameterInfo(int index)
IIndicator
getInputParameterInfo
in interface IIndicator
index
- index of the inputpublic int getLookback()
IIndicator
getLookback
in interface IIndicator
public int getLookforward()
IIndicator
getLookforward
in interface IIndicator
public OptInputParameterInfo getOptInputParameterInfo(int index)
IIndicator
getOptInputParameterInfo
in interface IIndicator
index
- index of the optional inputpublic OutputParameterInfo getOutputParameterInfo(int index)
IIndicator
getOutputParameterInfo
in interface IIndicator
index
- index of the outputpublic void setInputParameter(int index, Object array)
IIndicator
setInputParameter
in interface IIndicator
index
- index of the parameterarray
- array of the doubles, ints or prices represented as double[][]public void setOptInputParameter(int index, Object value)
IIndicator
setOptInputParameter
in interface IIndicator
index
- index of the parametervalue
- int or double valuepublic void setOutputParameter(int index, Object array)
IIndicator
IIndicator.calculate(int, int)
callsetOutputParameter
in interface IIndicator
index
- index of the parameterarray
- array of doubles or ints enough to hold values from startIndex to endIndexpublic double[] getMinMax(int outputIdx, Object values, int firstVisibleValueIndex, int lastVisibleValueIndex)
IMinMax
getMinMax
in interface IMinMax
outputIdx
- index of the output parametervalues
- array of the values (int[], double[] or Object[] depending of the type of the output)firstVisibleValueIndex
- index of the first value that corresponds to the candle that is visible on the screen. Will be 0 even if the values array is with the length of 0lastVisibleValueIndex
- index of the last value that corresponds to the candle that is visible on the screen. Will be -1 if the values array is with the length of 0Copyright © 2016. All rights reserved.