INVITE-ONLY SCRIPT

online Moment-Based Adaptive Detection

66
🙏🏻 oMBAD (online Moment-Based Adaptive Detection): adaptive anomaly || outlier || novelty detection, higher-order standardized moments; at O(1) time complexity

For TradingView users: this entity would truly unleash its true potential for you ‘only’ if you work with tick-based & seconds-based resolutions, otherwise I recommend to keep using original non-online MBAD. Otherwise it may only help with a much faster backtesting & strategy development processes.

...

Main features :
  • O(1) time complexity: the whole method works @ O(1) time complexity, it’s lighting fast and cheap
  • HFT-ready: frequency, amount and magnitude of data points are irrelevant
  • Axiomatic: no need to optimize or to provide arbitrary hyperparameters, adaptive thresholds are completely data-driven and based on combination of higher-order central moments
  • Accepts weights: the method can gain additional information by accepting weights (e.g. volume weighting)



Example use cases for high-frequency trading:
  • Ordeflow analysis: can be applied on non-aggregated flow of market orders to gauge its imbalance and momentum
  • Liquidity provision: can be applied to high-resolution || tick data to place and dynamically adjust prices of limit orders
  • ML-based signals: online estimates of higher-order central moments can be used as features & in further feature engineering for trading signal generation
  • Operation & control: can be applied on PnL stream of your strategy for immediate returns analysis and equity control



Abstract:
This method is the online version of originally O(n) MBAD (Moment-Based Adaptive Detection). It uses higher-order central & standardized moments to naturally estimate data’s extremums using all data while not touching order-statistics (i.e. current min and max) at all. By the same principles it also estimates “ever-possible” values given the data-generating process stays the same.

This online version achieves reduced time complexity to O(1) by using weighted exponential smoothing, and in particular is based on Pebay et al (2008) work, which provides mathematically correct results for the moments, and is numerically stable, unlike the raw sum-based estimates of moments.

Additionally, I provide adjustments for non-continuous lattice geometry of orderbooks, and correct re-quantization math, allowing to artificially increase the native tick size.

The guidelines of how to adjust alpha (smoothing parameter of exponential smoothing) in order to completely match certain types of moving averages, or to minimize errors with ones when it’s impossible to match; are also provided.

Mathematical correctness of the realization was verified experimentally by observing the exact match with the original non-recursive MBAD in expanding window mode, and confirmed by 2 AI agents independently. Both weighted and non-weighted versions were tested successfully.

...

istantanea
^^ On micro level with moving window size 1

istantanea
^^ With artificial tick size increase, moving window size 64

istantanea
^^ Expanding window mode anchored to session start

istantanea
^^ Demonstrates numerical stability even on very large inputs

...

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.