AnomalyBERT in Python: Detecting Anomalies Across Correlated Assets

Disclosure: EODHD provides me with free access to its data, which is used in this article. The article also contains an affiliate link to EODHD: if you sign up through it, I may receive a commission at no extra cost to you. The analysis and conclusions presented are my own and are for educational purposes only, not investment advice.

Two-panel chart of Coca-Cola (KO) and PepsiCo (PEP) adjusted close prices from 2018 to September 2026, with the AnomalyBERT-lite anomaly score below. The score stays mostly between 0.2 and 0.4, with isolated spikes, the highest in early 2022 and another near 0.87 in May 2026.

 

A typical anomaly-detection example in finance looks at a single price series in isolation — a spike, a gap, a sudden jump in volatility. But some of the most useful signals only show up in the relationship between two or more series: two normally co-moving stocks suddenly diverging, a hedge that stops hedging, a spread that breaks its historical pattern.

Read the full article on EODHD Academy: Detecting Anomalies Across Correlated Assets with AnomalyBERT in Python

References

EODHD. (n.d.). EODHD Financial Data APIs [Data set]. Use my personal code DROZIMEK10 for 10% off your first purchase.

Dr Krzysztof Ozimek
Dr Krzysztof Ozimek
Quantitative Investment & Trading Research Educator

Leave a Reply

Your email address will not be published. Required fields are marked *