Skip to content

Analytics

FlintDB includes powerful analytics capabilities without external dependencies.

Use aggregates with or without groupBy:

{
"collection": "trades",
"aggregate": {
"total": { "sum": "amount" },
"average": { "avg": "price" },
"highest": { "max": "price" },
"lowest": { "min": "price" },
"count": { "count": true }
}
}

Apply calculations across ordered sets of rows:

{
"collection": "stocks",
"window": {
"movingAvg": { "avg": "close", "window": 20 },
"cumSum": { "sum": "volume", "cumulative": true }
},
"sort": { "date": "asc" }
}

Built-in statistical analysis:

  • Descriptive: mean, median, stddev, variance, percentile
  • Correlation: pearson, covariance
  • Regression: linear regression

Specialized indicators for financial data:

  • Moving averages: SMA, EMA, WMA
  • Volatility: Bollinger Bands, ATR
  • Momentum: RSI, MACD, Stochastic
  • Volume: OBV, VWAP