|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IIndicator
Interface that should be implemented by custom(user) indicators. Interface is more like ta-lib library abstract call interface
Method Summary | |
---|---|
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. |
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. |
Method Detail |
---|
void onStart(IIndicatorContext context)
context
- allows access to system functionalityIndicatorInfo getIndicatorInfo()
InputParameterInfo getInputParameterInfo(int index)
index
- index of the input
OptInputParameterInfo getOptInputParameterInfo(int index)
index
- index of the optional input
OutputParameterInfo getOutputParameterInfo(int index)
index
- index of the output
void setInputParameter(int index, Object array)
index
- index of the parameterarray
- array of the doubles, ints or prices represented as double[][]void setOptInputParameter(int index, Object value)
index
- index of the parametervalue
- int or double valuevoid setOutputParameter(int index, Object array)
calculate(int, int)
call
index
- index of the parameterarray
- array of doubles or ints enough to hold values from startIndex to endIndexint getLookback()
IndicatorResult calculate(int startIndex, int endIndex)
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 value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |