Functions
The following functions are available globally.
-
Simple moving average
Declaration
Swift
public func sma(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The inputs
n
The period
-
Weighted moving average
Declaration
Swift
public func wma(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The inputs
n
The period
-
Exponential moving average
Declaration
Swift
public func ema(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The inputs
n
The period
-
Double exponential moving average
Declaration
Swift
public func dema(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The inputs
n
The period
-
Triple exponential moving average
Declaration
Swift
public func tema(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The inputs
n
The period
-
Triangular Moving Average
Declaration
Swift
public func trima(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The inputs
n
The period
-
Kaufman Adaptive Moving Average /// - Parameter inputs: The inputs
Declaration
Swift
public func kama(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
n
The period
-
Compute the values of the three components of the bollinger bands
Declaration
Swift
public func bbands(_ inputs: [Double], period: Int, stddev: Double) -> (Int, BBandResult)
Parameters
period
The period
stddev
The standard deviation
inputs
The inputs
Return Value
The result as a tuple of (
Int
,BBBandResult
) -
Vector Absolute Value
Declaration
Swift
public func abs(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs values
-
Declaration
Swift
public func acos(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs values
-
Vector addition
Declaration
Swift
public func add(a: [Double], b: [Double]) -> (Int, [Double])
Parameters
a
Inputs A
b
Inputs B
-
Absolute Price Oscillator
Declaration
Swift
public func apo(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The input values
-
Aroon
Declaration
Swift
public func arroon<T>(_ inputs: [T], period n: Int) -> (Int, ArroonResult) where T : Quotable
Parameters
inputs
An array of
Quotable
elementsn
The period
-
Vector Arcsine
Declaration
Swift
public func asin(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs values
-
Vector Arctangent
Declaration
Swift
public func atan(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs values
-
Average True Range
Declaration
Swift
public func atr<T>(_ inputs: [T], period n: Int) -> (Int, [Double]) where T : Quotable
Parameters
inputs
The inputs
n
The period
-
Vector Ceiling
Declaration
Swift
public func ceil(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Chande Momentum Oscillator
Declaration
Swift
public func cmo(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The inputs
n
The period
-
Vector Cosine
Declaration
Swift
public func cos(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Vector Hyperbolic Cosine
Declaration
Swift
public func cosh(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Crossany
Declaration
Swift
public func crossany(a: [Double], b: [Double]) -> (Int, [Double])
Parameters
a
A values
b
B values
-
Crossover
Declaration
Swift
public func crossover(a: [Double], b: [Double]) -> (Int, [Double])
Parameters
a
A values
b
B values
-
Linear Decay
Declaration
Swift
public func decay(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The input values
n
The period
-
Vector division
Declaration
Swift
public func div(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Detrended Price Oscillator
Declaration
Swift
public func dpo(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The input values
n
The period
-
Exponential Decay
Declaration
Swift
public func edecay(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The input values
n
The period
-
Vector Exponential
Declaration
Swift
public func exp(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Fisher Transform
Declaration
Swift
public func fisher<T>(_ inputs: [T], period n: Int) -> (Int, FisherResult) where T : Quotable
Parameters
inputs
An array of
Quotable
elementsn
The period
-
Vector Floor
Declaration
Swift
public func floor(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Forecast Oscillator
Declaration
Swift
public func fosc(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The input values
n
The period
-
Hull Moving Average
Declaration
Swift
public func hma(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The inputs
n
The period
-
Klinger Volume Oscillator
Declaration
Swift
public func kvo<T>(_ inputs: [T], short: Int, long: Int) -> (Int, [Double]) where T : Quotable
Parameters
inputs
The input values
short
The short period
long
The long period
-
Lag
Declaration
Swift
public func lag(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The period
inputs
The period
-
Linear Regression
Declaration
Swift
public func linreg(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The period
inputs
The period
-
Linear Regression Intercept
Declaration
Swift
public func linregintercept(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The period
inputs
The period
-
Linear Regression Slope
Declaration
Swift
public func linregslope(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The period
inputs
The period
-
Vector Natural Log
Declaration
Swift
public func ln(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Vector Base-10 Log
Declaration
Swift
public func log10(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Moving Average Convergence/Divergence
Declaration
Swift
public func macd(_ inputs: [Double], short: Int, long: Int, signal: Int) -> (Int, MACDResult)
Parameters
inputs
The inputs values
short
The short period
long
The long period
signal
The signal period
-
Maximum In Period
Declaration
Swift
public func max(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
An array of
Quotable
elements. -
Mean Deviation Over Period
Declaration
Swift
public func md(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
An array of
Quotable
elements. -
Momentum
Declaration
Swift
public func mom(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
An array of
Quotable
elements. -
Mesa Sine Wave
Declaration
Swift
public func msw(_ inputs: [Double], period n: Int) -> (Int, MSWResult)
Parameters
inputs
The input values
-
Vector Multiplication
Declaration
Swift
public func mul(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Percentage Price Oscillator
Declaration
Swift
public func ppo(_ inputs: [Double], short: Int, long: Int) -> (Int, [Double])
Parameters
inputs
The inputs
-
Rate of Change
Declaration
Swift
public func roc(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The input values
-
Rate of Change Ratio
Declaration
Swift
public func rocr(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The input values
-
Vector Round
Declaration
Swift
public func round(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Relative Strength Index
Declaration
Swift
public func rsi(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The input values
-
Vector Sine
Declaration
Swift
public func sin(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Vector Hyperbolic Sine
Declaration
Swift
public func sinh(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Vector Sqrt
Declaration
Swift
public func sqrt(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Standard Deviation Over Period
Declaration
Swift
public func stddev(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The input values
-
Standard Error Over Period
Declaration
Swift
public func stderr(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The input values
-
Stochastic Oscillator
Declaration
Swift
public func stoch<T>(_ inputs: [T], kPeriod: Int, kSlowingPeriod: Int, dPeriod: Int) -> (Int, StochResult) where T : Quotable
Parameters
inputs
An array of
Quotable
elements.period
The period
-
Stochastic RSI
Declaration
Swift
public func stochrsi(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The input values
-
Vector Substraction
Declaration
Swift
public func sub(a: [Double], b: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Sum Over Period
Declaration
Swift
public func sum(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
An array of
Quotable
elements. -
Vector Tangent
Declaration
Swift
public func tan(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Vector Hyperbolic Tangent
Declaration
Swift
public func tanh(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Vector Degree Conversion
Declaration
Swift
public func todeg(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Vector Radian Conversion
Declaration
Swift
public func torad(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Trix
Declaration
Swift
public func trix(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
An array of
Quotable
elements. -
Vector Truncate
Declaration
Swift
public func trunc(_ inputs: [Double]) -> (Int, [Double])
Parameters
inputs
The inputs
-
Time Series Forecast
Declaration
Swift
public func tsf(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
An array of
Quotable
elements. -
Variance Over Period
Declaration
Swift
public func variance(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The input values
-
Vertical Horizontal Filter
Declaration
Swift
public func vhf(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The input values
-
Variable Index Dynamic Average
Declaration
Swift
public func vidya(_ inputs: [Double], short: Int, long: Int, alpha: Double) -> (Int, [Double])
Parameters
inputs
The input values
short
The short period
long
The long period
alpha
The alpha value
-
Annualized Historical Volatility
Declaration
Swift
public func volatility(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The input values
-
Wilders Smoothing
Declaration
Swift
public func wilders(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The input values
-
Zero-Lag Exponential Moving Average
Declaration
Swift
public func zlema(_ inputs: [Double], period n: Int) -> (Int, [Double])
Parameters
inputs
The inputs
n
The period