OpenAPI 1.0

com.aquafold.openapi.math
Interface AQFinancial


public interface AQFinancial


Method Summary
 double[] accdistosc(double[] high, double[] low, double[] close, double[] volume)
          Calculates Accumulation Distribution (Chaikin) Oscillator for incoming data.
 double[] accumdistrib(double[] high, double[] low, double[] close, double[] volume)
          Calculates accumulation/distribution line of incoming data.
 double[][] bollinger(double[] in, int span)
          Returns Bollinger bands for incoming data.
 double[] chaikinmoneyflow(double[] high, double[] low, double[] close, double[] volume, int span)
          Calculates Chaikin Money Flow for incoming data.
 double[] chaikinosc(double[] high, double[] low, double[] close, double[] volume)
          Calculates Chaikin Oscillator for incoming data.
 double[] chvol(double[] high, double[] low, int span)
          Calculates Chaikin volitility.
 double clv(double high, double low, double close)
          Calculates close location value of incoming data.
 double[] ema(double[] in, int span)
          Calculates Exponential moving average-- moving average whose weighting factors decrease exponentially.
 double[] hhigh(double[] close, int span)
          Calculates highest high in a given period
 double[] llow(double[] close, int span)
          Calculates lowest low in a given period
 double[][] macd(double[] in, int fastspan, int slowspan, int convspan)
          Returns moving average convergence/divergence for incoming data.
 double[] medianprice(double[] high, double[] low)
          Calculates median price of incoming data..
 double[] momentum(double[] close, int span)
          Calculates momentum of incoming data.
 double[] movingaverage(double[] in, int span)
          Calculates Simple Moving average [link]
 double[] movingstd(double[] in, int span)
          Calculates Moving Standard Deviation.
 double[] nvi(double[] volume, double[] close)
          Calculates negative volume index of incoming data.
 double[] obv(double[] volume, double[] close)
          Calculates on balance volume of incoming data.
 double[] proc(double[] close, int span)
          Returns price rate of change of incoming data.
 double[] pvi(double[] volume, double[] close)
          Calculates positive volume index of incoming data.
 double[] pvt(double[] volume, double[] close)
          Calculates price and volume trend of incoming data.
 double[] rsi(double[] close, int span)
          Calculates Relative strength index of incoming data.
 double[][] stochosc(double[] high, double[] low, double[] close)
          Calculates default (14-day fast) stochastic oscillator.
 double[][] stochosc(double[] high, double[] low, double[] close, int span, int smoothspan)
          Calculates general stochastic oscillator.
 double[][] stochosc(double[] high, double[] low, double[] close, int span, String option)
          Calculates fast or slow stochastic oscillator of user defined width.
 double sum(double[] in)
          Calculates sum of incoming data
 double[] trh(double[] high, double[] close)
          Calculates True Range High of incoming array.
 double[] trl(double[] low, double[] close)
          Calculates True Range Low of incoming array.
 double[] typicalprice(double[] high, double[] low, double[] close)
          Calculates typical price of incoming data.
 double[] vroc(double[] volume, int span)
          Calculates volume rate of change.
 double[] waccumdistrib(double[] high, double[] low, double[] close)
          Calculates Williams accumulation/distribution of incoming data.
 double[] wclose(double[] high, double[] low, double[] close)
          Calculates weighted close.
 

Method Detail

accumdistrib

double[] accumdistrib(double[] high,
                      double[] low,
                      double[] close,
                      double[] volume)
Calculates accumulation/distribution line of incoming data. Finds relative difference between high, low, and close and scaled by volume. Determines whether investors are generally buying or selling. [link]

Parameters:
high - a double precision array.
low - a double precision array.
close - a double precision array.
volume - a double precision array.
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

clv

double clv(double high,
           double low,
           double close)
Calculates close location value of incoming data. Scales the closing value of a stock to the difference between high and low prices. [link]

Parameters:
high - a double precision value.
low - a double precision value.
close - a double precision value.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming data is empty

chaikinosc

double[] chaikinosc(double[] high,
                    double[] low,
                    double[] close,
                    double[] volume)
Calculates Chaikin Oscillator for incoming data. See also accumulation/distribution oscillator [link]

Parameters:
high - a double precision array.
low - a double precision array.
close - a double precision array.
volume - a double precision array.
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

sum

double sum(double[] in)
Calculates sum of incoming data

Parameters:
in - incoming data array
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

accdistosc

double[] accdistosc(double[] high,
                    double[] low,
                    double[] close,
                    double[] volume)
Calculates Accumulation Distribution (Chaikin) Oscillator for incoming data. Finds relative difference between high, low, and close and scaled by volume. Determines whether investors are generally buying or selling. [link]

Parameters:
high - a double precision array.
low - a double precision array.
close - a double precision array.
volume - a double precision array.
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

chaikinmoneyflow

double[] chaikinmoneyflow(double[] high,
                          double[] low,
                          double[] close,
                          double[] volume,
                          int span)
Calculates Chaikin Money Flow for incoming data. Compares closing price to price range and determines if data is under accumulation or distribution. [link]

Parameters:
high - a double precision array.
low - a double precision array.
close - a double precision array.
volume - a double precision array.
span - an integer value
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

ema

double[] ema(double[] in,
             int span)
Calculates Exponential moving average-- moving average whose weighting factors decrease exponentially. [link]

Parameters:
in - a double precision array.
span - an integer
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

movingaverage

double[] movingaverage(double[] in,
                       int span)
Calculates Simple Moving average [link]

Parameters:
in - a double precision array.
span - an integer
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

movingstd

double[] movingstd(double[] in,
                   int span)
Calculates Moving Standard Deviation. Measures variability of data during period. [link]

Parameters:
in - a double precision array.
span - an integer
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

bollinger

double[][] bollinger(double[] in,
                     int span)
Returns Bollinger bands for incoming data. Calculates 2 standard deviations above (bollinger[][0]) and below (bollinger[][1]) the simple moving average. [link]

Parameters:
in - a double precision array.
span - an integer
Returns:
Nx3 double precision array, where N is length of incoming data
  • moving average of incoming data
  • upper and lower Bollinger bands
Throws:
IllegalArgumentException - if the incoming array is empty

macd

double[][] macd(double[] in,
                int fastspan,
                int slowspan,
                int convspan)
Returns moving average convergence/divergence for incoming data. Calculates the difference between fast and slow exponential moving averages of incoming data. [link]

Parameters:
in - a double precision array.
fastspan - an integer
slowspan - an integer
convspan - an integer
Returns:
Nx2 double precision array, where N is length of incoming data
  • moving average convergence/divergence line (macd) is first double vector
  • signal line (signal) is second double vector
Throws:
IllegalArgumentException - if the incoming array is empty

chvol

double[] chvol(double[] high,
               double[] low,
               int span)
Calculates Chaikin volitility. Calculates range between high and low for given period. [link]

Parameters:
high - a double precision array.
low - a double precision array.
span - a double precision array.
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

momentum

double[] momentum(double[] close,
                  int span)
Calculates momentum of incoming data. Finds change in price over period. [link]

Parameters:
close - a double precision array.
span - an integer
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

nvi

double[] nvi(double[] volume,
             double[] close)
Calculates negative volume index of incoming data. Index which tracks days which close lower than the previous day. [link]

Parameters:
volume - a double precision array.
close - a double precision array
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

pvi

double[] pvi(double[] volume,
             double[] close)
Calculates positive volume index of incoming data. Index which tracks days which close higher than the previous day. [link]

Parameters:
volume - a double precision array.
close - a double precision array
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

obv

double[] obv(double[] volume,
             double[] close)
Calculates on balance volume of incoming data. Accumulator relating momentum to volume. [link]

Parameters:
volume - a double precision array.
close - a double precision array
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

proc

double[] proc(double[] close,
              int span)
Returns price rate of change of incoming data. Calculates the relative change in price over a given period. [link]

Parameters:
close - a double precision array.
span - an integer
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

pvt

double[] pvt(double[] volume,
             double[] close)
Calculates price and volume trend of incoming data. Accumulator of daily volume, scaled by relative change in closing price. [link]

Parameters:
volume - a double precision array.
close - an integer
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

rsi

double[] rsi(double[] close,
             int span)
Calculates Relative strength index of incoming data. The ratio of the exponential moving averages of upward and downward movements of closing price. [link]

Parameters:
close - a double precision array.
span - an integer
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

vroc

double[] vroc(double[] volume,
              int span)
Calculates volume rate of change. Calculates the relative change in volume over a given period. [link]

Parameters:
volume - a double precision array.
span - an integer
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

typicalprice

double[] typicalprice(double[] high,
                      double[] low,
                      double[] close)
Calculates typical price of incoming data. Average of high, low and close. [link]

Parameters:
high - a double precision array.
low - a double precision array
close - a double precision array
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

medianprice

double[] medianprice(double[] high,
                     double[] low)
Calculates median price of incoming data.. Calculates middle point between data pairs in incoming data sets. [link]

Parameters:
high - a double precision array.
low - a double precision array
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

hhigh

double[] hhigh(double[] close,
               int span)
Calculates highest high in a given period

Parameters:
close - a double precision array.
span - an integer
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

llow

double[] llow(double[] close,
              int span)
Calculates lowest low in a given period

Parameters:
close - a double precision array.
span - an integer
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

stochosc

double[][] stochosc(double[] high,
                    double[] low,
                    double[] close)
Calculates default (14-day fast) stochastic oscillator. Momentum indicator depending on percentage changes in closing price, scaled by daily range. [link]

Parameters:
high - a double precision array.
low - a double precision array.
close - a double precision array.
Returns:
Nx2 double precision array
  • First return vector is %K
  • Second return vector is %D
Throws:
IllegalArgumentException - if the incoming array is empty

stochosc

double[][] stochosc(double[] high,
                    double[] low,
                    double[] close,
                    int span,
                    String option)
Calculates fast or slow stochastic oscillator of user defined width. Momentum indicator depending on percentage changes in closing price, scaled by daily range. [link]

Parameters:
high - a double precision array.
low - a double precision array.
close - a double precision array.
span - an integer
option - a string
  • fast (smooths over smaller window)
  • slow (smooths over longer window)
Returns:
Nx2 double precision array
  • First return vector is %K
  • Second return vector is %D
Throws:
IllegalArgumentException - if the incoming array is empty

stochosc

double[][] stochosc(double[] high,
                    double[] low,
                    double[] close,
                    int span,
                    int smoothspan)
Calculates general stochastic oscillator. Momentum indicator depending on percentage changes in closing price, scaled by daily range. [link]

Parameters:
high - a double precision array.
low - a double precision array.
close - a double precision array.
span - an integer
smoothspan - an integer
  • span controls oscillator period
  • smoothspan controls smoothing period
Returns:
Nx2 double precision array
  • First return vector is %K
  • Second return vector is %D
Throws:
IllegalArgumentException - if the incoming array is empty

wclose

double[] wclose(double[] high,
                double[] low,
                double[] close)
Calculates weighted close. Running average of daily price with additional weighting for the close. [link]

Parameters:
high - a double precision array.
low - a double precision array.
close - a double precision array.
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

trh

double[] trh(double[] high,
             double[] close)
Calculates True Range High of incoming array. Daily high or previous close, whichever is higher. [link]

Parameters:
high - a double precision array.
close - a double precision array.
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

trl

double[] trl(double[] low,
             double[] close)
Calculates True Range Low of incoming array. Daily low or previous close, whichever is lower. [link]

Parameters:
low - a double precision array.
close - a double precision array.
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

waccumdistrib

double[] waccumdistrib(double[] high,
                       double[] low,
                       double[] close)
Calculates Williams accumulation/distribution of incoming data. Accumulator of daily positive and negative price movments. [link]

Parameters:
high - a double precision array.
low - a double precision array.
close - a double precision array.
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.