Module financial
Source - LogReturnsFunction
- LOG_RETURNS function - calculates logarithmic returns
Log Returns = ln(price[t] / price[t-1])
- ReturnsFunction
- RETURNS function - calculates simple returns from price series
Returns = (price[t] - price[t-1]) / price[t-1]
- SharpeRatioFunction
- SHARPE_RATIO function - calculates Sharpe ratio
Sharpe = (mean_return - risk_free_rate) / volatility
- StdDevFunction
- STDDEV function - calculates standard deviation (sample)
This is an alias for VOLATILITY but more SQL-standard
- VolatilityFunction
- VOLATILITY function - calculates standard deviation of returns
This is a simplified version that takes an array of returns
- register_financial_functions
- Register all financial functions