Current section
Files
Jump to
Current section
Files
src/ursatoro.erl
-module(ursatoro).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/ursatoro.gleam").
-export([candle/5, sma/2, ema/2, macd/4, rsi/2, stochastic/3, bollinger_bands/3, atr/2, vwap/1, obv/1, momentum_factor/2, har_volatility/4, kalman_new/1, kalman_update/4, kalman_smooth/3, savitzky_golay/3, vpin/2, roll_measure/2, amihud/3]).
-file("src/ursatoro.gleam", 15).
-spec candle(float(), float(), float(), float(), float()) -> ursatoro@candle:candle().
candle(Open, High, Low, Close, Volume) ->
ursatoro@candle:new(Open, High, Low, Close, Volume).
-file("src/ursatoro.gleam", 27).
-spec sma(list(ursatoro@candle:candle()), integer()) -> {ok, list(float())} |
{error, ursatoro@util:indicator_error()}.
sma(Candles, Period) ->
ursatoro@trend:sma(Candles, Period).
-file("src/ursatoro.gleam", 34).
-spec ema(list(ursatoro@candle:candle()), integer()) -> {ok, list(float())} |
{error, ursatoro@util:indicator_error()}.
ema(Candles, Period) ->
ursatoro@trend:ema(Candles, Period).
-file("src/ursatoro.gleam", 41).
-spec macd(list(ursatoro@candle:candle()), integer(), integer(), integer()) -> {ok,
list(ursatoro@trend:macd_result())} |
{error, ursatoro@util:indicator_error()}.
macd(Candles, Fast, Slow, Signal) ->
ursatoro@trend:macd(Candles, Fast, Slow, Signal).
-file("src/ursatoro.gleam", 52).
-spec rsi(list(ursatoro@candle:candle()), integer()) -> {ok, list(float())} |
{error, ursatoro@util:indicator_error()}.
rsi(Candles, Period) ->
ursatoro@momentum:rsi(Candles, Period).
-file("src/ursatoro.gleam", 59).
-spec stochastic(list(ursatoro@candle:candle()), integer(), integer()) -> {ok,
list(ursatoro@momentum:stochastic_result())} |
{error, ursatoro@util:indicator_error()}.
stochastic(Candles, K_period, D_period) ->
ursatoro@momentum:stochastic(Candles, K_period, D_period).
-file("src/ursatoro.gleam", 69).
-spec bollinger_bands(list(ursatoro@candle:candle()), integer(), float()) -> {ok,
list(ursatoro@volatility:bollinger_bands_result())} |
{error, ursatoro@util:indicator_error()}.
bollinger_bands(Candles, Period, Num_std) ->
ursatoro@volatility:bollinger_bands(Candles, Period, Num_std).
-file("src/ursatoro.gleam", 77).
-spec atr(list(ursatoro@candle:candle()), integer()) -> {ok, list(float())} |
{error, ursatoro@util:indicator_error()}.
atr(Candles, Period) ->
ursatoro@volatility:atr(Candles, Period).
-file("src/ursatoro.gleam", 86).
-spec vwap(list(ursatoro@candle:candle())) -> {ok, list(float())} |
{error, ursatoro@util:indicator_error()}.
vwap(Candles) ->
ursatoro@volume:vwap(Candles).
-file("src/ursatoro.gleam", 90).
-spec obv(list(ursatoro@candle:candle())) -> {ok, list(float())} |
{error, ursatoro@util:indicator_error()}.
obv(Candles) ->
ursatoro@volume:obv(Candles).
-file("src/ursatoro.gleam", 97).
-spec momentum_factor(list(ursatoro@candle:candle()), integer()) -> {ok,
list(float())} |
{error, ursatoro@util:indicator_error()}.
momentum_factor(Candles, Window) ->
ursatoro@momentum:momentum_factor(Candles, Window).
-file("src/ursatoro.gleam", 110).
-spec har_volatility(
list(ursatoro@candle:candle()),
integer(),
integer(),
integer()
) -> {ok, list(ursatoro@volatility:har_result())} |
{error, ursatoro@util:indicator_error()}.
har_volatility(Candles, Daily, Weekly, Monthly) ->
ursatoro@volatility:har_volatility(Candles, Daily, Weekly, Monthly).
-file("src/ursatoro.gleam", 125).
-spec kalman_new(float()) -> ursatoro@filter:kalman_state().
kalman_new(Initial_price) ->
ursatoro@filter:kalman_new(Initial_price).
-file("src/ursatoro.gleam", 129).
-spec kalman_update(ursatoro@filter:kalman_state(), float(), float(), float()) -> ursatoro@filter:kalman_state().
kalman_update(State, Observation, Q, R) ->
ursatoro@filter:kalman_update(State, Observation, Q, R).
-file("src/ursatoro.gleam", 138).
-spec kalman_smooth(list(float()), float(), float()) -> {ok, list(float())} |
{error, ursatoro@util:indicator_error()}.
kalman_smooth(Prices, Q, R) ->
ursatoro@filter:kalman_smooth(Prices, Q, R).
-file("src/ursatoro.gleam", 146).
-spec savitzky_golay(list(float()), integer(), integer()) -> {ok, list(float())} |
{error, ursatoro@util:indicator_error()}.
savitzky_golay(Prices, Window_length, Polyorder) ->
ursatoro@filter:savitzky_golay(Prices, Window_length, Polyorder).
-file("src/ursatoro.gleam", 160).
-spec vpin(list(ursatoro@microstructure:trade_bar()), integer()) -> {ok,
list(float())} |
{error, ursatoro@util:indicator_error()}.
vpin(Trade_bars, Window) ->
ursatoro@microstructure:vpin(Trade_bars, Window).
-file("src/ursatoro.gleam", 167).
-spec roll_measure(list(float()), integer()) -> {ok, list(float())} |
{error, ursatoro@util:indicator_error()}.
roll_measure(Prices, Window) ->
ursatoro@microstructure:roll_measure(Prices, Window).
-file("src/ursatoro.gleam", 174).
-spec amihud(list(float()), list(float()), integer()) -> {ok, list(float())} |
{error, ursatoro@util:indicator_error()}.
amihud(Prices, Volumes, Window) ->
ursatoro@microstructure:amihud(Prices, Volumes, Window).