com.exponto.jstock.indicators
Interface IndicatorValuesInterface

All Known Implementing Classes:
Rsi

public interface IndicatorValuesInterface

Allows other parts of the application to access parameters and values of an indicator. It's up to the classes implementing this interface to decide what parameters and values that are exposed. The intended use of this interface is to present all avaliable paramters to the user, so that (s)he can set up a list of rules that would trigger events like a sell or buy signal. Examples: RSI < 20 triggers buy signal MACD < MACD.triggerline triggers sell signal

Author:
kaare

Method Summary
 java.lang.String[] parameters()
          Gives the calling class a list of parameters that is available.
 java.lang.String[] parametersToolTip()
          Gives the calling class a string array with tool tips that can be presented to the user.
 java.lang.Double parameterValue(java.lang.String parameter)
          Returns the value for the last day of the requested parameter.
 java.lang.Double parameterValue(java.lang.String parameter, int index)
          Returns the value for the last day minus index of the requested parameter.
 

Method Detail

parameters

public java.lang.String[] parameters()
Gives the calling class a list of parameters that is available. The parameters name shall have print quality.

Returns:
a string array of the parameters that is available

parametersToolTip

public java.lang.String[] parametersToolTip()
Gives the calling class a string array with tool tips that can be presented to the user. It is crucial that the tool tip is in the same order as the parameter name, but null is a valid tool tip. The tool tips shall have print quality.

Returns:
a string array with tool tip explaing the parameters in more detail

parameterValue

public java.lang.Double parameterValue(java.lang.String parameter)
Returns the value for the last day of the requested parameter. null shall be returned if no value is avaliable. Assumes that all parameters are doubles.

Parameters:
parameter - The name of the parameter
Returns:
the last value of the requested parameter.

parameterValue

public java.lang.Double parameterValue(java.lang.String parameter,
                                       int index)
Returns the value for the last day minus index of the requested parameter. null shall be returned if no value is avaliable. The value of index has to be verified against the real length of the indicatorSeries as the calling class has no idea about that. Assumes that all parameters are doubles.

Parameters:
parameter - The name of the parameter
index - The index
Returns:
the value of the requested parameter for the requested day.


Copyright © 2004 Kaare Ranum