{"id":7184,"date":"2024-02-01T11:00:07","date_gmt":"2024-02-01T11:00:07","guid":{"rendered":"https:\/\/eodhd.com\/financial-academy\/?p=7184"},"modified":"2026-11-10T06:44:21","modified_gmt":"2026-11-10T06:44:21","slug":"benchmark-tracking-and-cointegration-analysis-with-python","status":"publish","type":"post","link":"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python","title":{"rendered":"Engle-Granger Cointegration Test in Python: Benchmark Tracking on the DAX"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The Engle-Granger cointegration test checks whether two or more non-stationary price series share a long-run equilibrium. It runs in two steps: an OLS regression of one series on the other, then a unit root test on the residuals. If the residuals are stationary, the series are cointegrated, which means the gap between them keeps returning to its average.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide runs the Engle-Granger cointegration test in Python on the DAX and its constituents, with daily EODHD data from March 2010 to November 2026. Only 1 of 33 stocks, Allianz, was cointegrated with the index at the 5% level. The guide then builds two portfolios that track the DAX, one based on cointegration and one that minimizes tracking error variance (TEVM), and measures both out of sample over more than 14 years. TEVM tracked the index more closely: an annualized tracking error of 2.04%, against 2.61% for the cointegration portfolio.<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><a class=\"maxbutton-1 maxbutton maxbutton-subscribe-to-api external-css btn\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/eodhd.com\/register\"><span class='mb-text'>Register &amp; Get Data<\/span><\/a><\/p>\n\n\n\n\n\n\n<h2 id=\"h-what-cointegration-means\" class=\"wp-block-heading\">What cointegration means<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A price series is non-stationary when its mean and variance change over time. Most stock prices and indices behave this way: they drift, and past levels don&#8217;t tell you where they will return to. A stationary series, by contrast, keeps returning to a stable mean.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two non-stationary series X and Y are cointegrated if some linear combination of them, such as Y &#8211; bX, is stationary. Each series can wander on its own, but the spread between them keeps coming back. That property is what pairs trading and index tracking rely on: investors expect a temporary gap to close.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Cointegration is different from correlation. Correlation measures how closely the returns of two series move together, usually over short horizons. Two stocks can be highly correlated and still drift apart over years, and two cointegrated series can have periods of low return correlation while their price levels stay tied.<\/p>\n\n\n\n<h2 id=\"h-how-the-engle-granger-cointegration-test-works\" class=\"wp-block-heading\">How the Engle-Granger cointegration test works<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Engle-Granger method, introduced by Robert Engle and Clive Granger in 1987, has two steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Regress one series on the other with ordinary least squares (OLS), using price levels or log prices, not returns: ln(Index) = a + b \u00d7 ln(Stock) + e.<\/li>\n\n\n\n<li>Test the residuals e for a unit root with an Augmented Dickey-Fuller (ADF) test. If the test rejects the unit root, the residuals are stationary and the series are cointegrated.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The ADF test on residuals needs its own critical values, because the residuals come from an estimated regression. In Python, statsmodels.tsa.stattools.coint runs both steps and returns the test statistic, its p-value and the right critical values.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Johansen test is the main alternative. It tests several series at once and can find more than one cointegrating relationship, while Engle-Granger tests one relationship at a time and depends on which series is on the left side of the regression.<\/p>\n\n\n\n<h2 id=\"h-how-to-get-your-eodhd-api-key\" class=\"wp-block-heading\">How to get your EODHD API key<\/h2>\n\n\n\n<p class=\"bordered_paragraph wp-block-paragraph\">1. Use the \u201cdemo\u201d API key to test our data from a limited set of tickers without registering:<br>AAPL.US | TSLA.US | VTI.US | AMZN.US | BTC-USD | EUR-USD<br>Real-Time Data and all of the APIs (except Bulk) are included without API calls limitations with these tickers and the demo key.<br>2. Register to get your free API key (limited to 20 API calls per day) with access to:<br>End-Of-Day Historical Data with only the past year for any ticker, and the List of tickers per Exchange.<br>3. To unlock your API key, we recommend to choose the <a href=\"https:\/\/eodhd.com\/pricing\" target=\"_blank\" rel=\"noreferrer noopener\">subscription plan<\/a> which covers your needs.<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><a class=\"maxbutton-1 maxbutton maxbutton-subscribe-to-api external-css btn\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/eodhd.com\/register\"><span class='mb-text'>Register &amp; Get Data<\/span><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This example needs 16 years of end-of-day prices for 40 tickers and the index constituents from the Fundamentals API, so it needs the All-In-One plan, or the EOD Historical All-World and Fundamentals Data Feed plans together.<\/p>\n\n\n\n<h2 id=\"h-getting-the-data-for-the-engle-granger-cointegration-test\" class=\"wp-block-heading\">Getting the data for the Engle-Granger cointegration test<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The index constituents come from the Fundamentals API (GDAXI.INDX, Components section), and the prices from the end-of-day API, with each stock on XETRA:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code class=\"\">import os<br>import sys<br><br>import pandas as pd<br>import requests<br><br>API_KEY = os.environ[\"EODHD_API_KEY\"]<br>BASE = \"https:\/\/eodhd.com\/api\"<br><br><br>def get(path, **params):<br>    resp = requests.get(f\"{BASE}\/{path}\", params={\"api_token\": API_KEY, \"fmt\": \"json\", **params}, timeout=60)<br>    resp.raise_for_status()<br>    return resp.json()<br><br><br>def adjusted_close(ticker, start, end):<br>    df = pd.DataFrame(get(f\"eod\/{ticker}\", **{\"from\": start, \"to\": end}))<br>    return df.set_index(pd.to_datetime(df[\"date\"]))[\"adjusted_close\"].astype(float)<br><br><br>start, end = sys.argv[1:3]<br>components = get(\"fundamentals\/GDAXI.INDX\", filter=\"Components\")<br>codes = [c[\"Code\"] for c in components.values()]<br>print(f\"Constituents returned: {len(codes)}\")<br><br>prices = {\"DAX\": adjusted_close(\"GDAXI.INDX\", start, end)}<br>for code in codes:<br>    prices[code] = adjusted_close(f\"{code}.XETRA\", start, end)<br><br>df = pd.DataFrame(prices).sort_index()<br>first = df.apply(lambda s: s.first_valid_index().date())<br>print(first.sort_values(ascending=False).head(15).to_string())<br>df.to_csv(\"dax_prices.csv\")<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p class=\"wp-block-paragraph\">Run with python get_dax_data.py 2010-01-01 2026-11-06. The endpoint returned 39 constituent codes on the day of the run, and the first lines of the output show which of them have a shorter history:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code class=\"\">Constituents returned: 39<br>DTG     2021-12-13<br>ENR     2020-09-28<br>SHL     2018-03-16<br>G24     2015-10-01<br>ZAL     2014-10-01<br>VNA     2013-07-11<br>BNR     2010-03-29<br>AIR     2010-01-04<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p class=\"wp-block-paragraph\">Six stocks, Daimler Truck, Siemens Energy, Siemens Healthineers, Scout24, Zalando and Vonovia, started trading after the start of the sample, so the analysis drops them and starts on March 29, 2010, the first date with prices for Brenntag. That leaves 33 stocks and 4,216 trading days.<\/p>\n\n\n\n<h2 id=\"h-running-the-engle-granger-cointegration-test-on-each-dax-stock\" class=\"wp-block-heading\">Running the Engle-Granger cointegration test on each DAX stock<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The first test checks each stock against the index, one at a time, with log prices on both sides:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code class=\"\">import sys<br><br>import numpy as np<br>import pandas as pd<br>import statsmodels.api as sm<br>from statsmodels.tsa.stattools import adfuller, coint<br><br>prices = pd.read_csv(sys.argv[1], index_col=0, parse_dates=True)<br><br># Keep the stocks with prices since the start of the sample<br>late = [c for c in prices.columns if prices[c].first_valid_index() &gt; pd.Timestamp(\"2010-03-31\")]<br>df = prices.drop(columns=late).dropna()<br>print(f\"Dropped (listed later): {', '.join(late)}\")<br>print(f\"Sample: {df.index[0].date()} to {df.index[-1].date()}, {len(df)} days, {df.shape[1] - 1} stocks\\n\")<br><br>logp = np.log(df)<br>ret = df.pct_change().dropna()<br><br># Step 1: Engle-Granger, one stock at a time<br>rows = []<br>for stock in logp.columns.drop(\"DAX\"):<br>    t_stat, p_value, crit = coint(logp[\"DAX\"], logp[stock])<br>    rows.append({\"stock\": stock, \"t_stat\": t_stat, \"p_value\": p_value, \"crit_5pct\": crit[1]})<br>eg = pd.DataFrame(rows).sort_values(\"p_value\")<br>print(\"ADF p-value of the index itself:\", round(adfuller(logp[\"DAX\"], result_object=False)[1], 3))<br>print(f\"Cointegrated with the DAX at 5%: {(eg['p_value'] &lt; 0.05).sum()} of {len(eg)}\")<br>print(eg.head(8).to_string(index=False, float_format=\"{:.3f}\".format), \"\\n\")<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p class=\"wp-block-paragraph\">The output, with statsmodels 0.15.0 and pandas 3.0.5:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code class=\"\">Dropped (listed later): ZAL, VNA, G24, SHL, ENR, DTG<br>Sample: 2010-03-29 to 2026-11-06, 4216 days, 33 stocks<br><br>ADF p-value of the index itself: 0.849<br>Cointegrated with the DAX at 5%: 1 of 33<br>stock  t_stat  p_value  crit_5pct<br>  ALV  -3.791    0.014     -3.338<br>  DTE  -3.260    0.060     -3.338<br>  SIE  -3.172    0.075     -3.338<br> MUV2  -3.144    0.080     -3.338<br>  DB1  -2.922    0.130     -3.338<br> EOAN  -2.901    0.136     -3.338<br>  RHM  -2.576    0.247     -3.338<br> HNR1  -2.541    0.261     -3.338<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1650\" height=\"825\" src=\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/engle-granger-dax-stocks.png\" alt=\"Engle-Granger test statistic for each DAX stock against the DAX index, with the 5% critical value\" class=\"wp-image-7181\" srcset=\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/engle-granger-dax-stocks.png 1650w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/engle-granger-dax-stocks-300x150.png 300w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/engle-granger-dax-stocks-1024x512.png 1024w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/engle-granger-dax-stocks-768x384.png 768w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/engle-granger-dax-stocks-1536x768.png 1536w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/engle-granger-dax-stocks-60x30.png 60w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/engle-granger-dax-stocks-150x75.png 150w\" sizes=\"auto, (max-width: 1650px) 100vw, 1650px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The ADF p-value of 0.849 for the log index means the test can&#8217;t reject a unit root, which is consistent with a non-stationary DAX and is the starting condition for a cointegration test. Of the 33 stocks, only Allianz (ALV) had a test statistic below the 5% critical value of -3.338. Deutsche Telekom, Siemens and Munich Re came close, with p-values between 0.06 and 0.08.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That result isn&#8217;t surprising. A single stock carries its own business risk, so over 16 years its price can drift far from the index even when the two are highly correlated day to day.<\/p>\n\n\n\n<h2 id=\"h-building-tracking-portfolios-cointegration-vs-tevm\" class=\"wp-block-heading\">Building tracking portfolios: cointegration vs TEVM<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A portfolio of many stocks has a better chance of staying tied to the index than any single stock. The two methods below build that portfolio from all 33 stocks with a rolling regression:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Cointegration: regress the log index on the log prices of the stocks, then use the coefficients as weights, scaled to sum to 1. This follows the approach in <a href=\"https:\/\/papers.ssrn.com\/sol3\/papers.cfm?abstract_id=315619\" target=\"_blank\" rel=\"noreferrer noopener\">Alexander and Dimitriu (2002)<\/a>.<\/li>\n\n\n\n<li>TEVM (tracking error variance minimization): regress the index returns on the stock returns. The OLS coefficients minimize the variance of the daily difference between portfolio and index, before the code scales them to sum to 1.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Both use a calibration window of 500 trading days, about two years, and rebalance every 10 trading days. The code then applies each set of weights only to the next 10 days, which the regression hasn&#8217;t seen, so the result is out of sample:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code class=\"\"># Step 2: rolling tracking portfolios, measured on the 10 days after each fit<br>WINDOW, STEP = 500, 10<br>stocks = logp.columns.drop(\"DAX\")<br>out = {\"coint\": [], \"tevm\": []}<br>adf_p = []<br>for i in range(WINDOW, len(ret) - STEP + 1, STEP):<br>    fit_lp = logp.iloc[i - WINDOW + 1:i + 1]<br>    fit_r = ret.iloc[i - WINDOW:i]<br>    m_c = sm.OLS(fit_lp[\"DAX\"], sm.add_constant(fit_lp[stocks])).fit()<br>    m_t = sm.OLS(fit_r[\"DAX\"], sm.add_constant(fit_r[stocks])).fit()<br>    adf_p.append(adfuller(m_c.resid, result_object=False)[1])<br>    w_c = m_c.params[stocks] \/ m_c.params[stocks].sum()<br>    w_t = m_t.params[stocks] \/ m_t.params[stocks].sum()<br>    nxt = ret.iloc[i:i + STEP]<br>    out[\"coint\"].append(nxt[stocks] @ w_c)<br>    out[\"tevm\"].append(nxt[stocks] @ w_t)<br><br>idx = ret[\"DAX\"]<br>rows = []<br>for name, label in [(\"coint\", \"Cointegration\"), (\"tevm\", \"TEVM\")]:<br>    p = pd.concat(out[name])<br>    b = idx.loc[p.index]<br>    diff = p - b<br>    rows.append({\"method\": label,<br>                 \"tracking_error_ann\": diff.std() * np.sqrt(252),<br>                 \"correlation\": p.corr(b),<br>                 \"portfolio_total\": (1 + p).prod() - 1,<br>                 \"index_total\": (1 + b).prod() - 1})<br>res = pd.DataFrame(rows)<br>first_day = pd.concat(out[\"coint\"]).index[0].date()<br>print(f\"Out of sample from {first_day}, {len(adf_p)} rebalances\")<br>print(f\"Calibration windows with stationary residuals (ADF p &lt; 0.05): {np.mean(np.array(adf_p) &lt; 0.05):.0%}\")<br>print(res.to_string(index=False, float_format=\"{:.4f}\".format))<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p class=\"wp-block-paragraph\">The output:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background\"><code class=\"\">Out of sample from 2012-03-08, 371 rebalances<br>Calibration windows with stationary residuals (ADF p &lt; 0.05): 100%<br>       method  tracking_error_ann  correlation  portfolio_total  index_total<br>Cointegration              0.0261       0.9902           2.5638       2.8702<br>         TEVM              0.0204       0.9940           2.9078       2.8702<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<h2 id=\"h-results-which-method-tracked-the-dax-better\" class=\"wp-block-heading\">Results: which method tracked the DAX better<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Out of sample, March 2012 to November 2026<\/th><th>Cointegration<\/th><th>TEVM<\/th><\/tr><\/thead><tbody><tr><td>Annualized tracking error<\/td><td>2.61%<\/td><td>2.04%<\/td><\/tr><tr><td>Correlation of daily returns with the DAX<\/td><td>0.9902<\/td><td>0.9940<\/td><\/tr><tr><td>Total return of the portfolio<\/td><td>256.38%<\/td><td>290.78%<\/td><\/tr><tr><td>Total return of the DAX<\/td><td>287.02%<\/td><td>287.02%<\/td><\/tr><tr><td>Cumulative difference at the end<\/td><td>-7.92%<\/td><td>+0.97%<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1650\" height=\"750\" src=\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/dax-tracking-cointegration-vs-tevm.png\" alt=\"Cumulative difference between each tracking portfolio and the DAX, out of sample\" class=\"wp-image-7182\" srcset=\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/dax-tracking-cointegration-vs-tevm.png 1650w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/dax-tracking-cointegration-vs-tevm-300x136.png 300w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/dax-tracking-cointegration-vs-tevm-1024x465.png 1024w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/dax-tracking-cointegration-vs-tevm-768x349.png 768w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/dax-tracking-cointegration-vs-tevm-1536x698.png 1536w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/dax-tracking-cointegration-vs-tevm-60x27.png 60w, https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2026\/11\/dax-tracking-cointegration-vs-tevm-150x68.png 150w\" sizes=\"auto, (max-width: 1650px) 100vw, 1650px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Both portfolios followed the index closely, with correlations above 0.99. On each of those measures, though, TEVM came closer: a lower tracking error, a higher correlation, and a cumulative gap of only 0.97% to the DAX at the end. The cointegration portfolio stayed below the index on 96.8% of the days, with a cumulative gap that reached -14.43% before narrowing to -7.92% at the end.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The 2024 edition of this article, built on the DAX 30, concluded that the cointegration approach tracked better than TEVM. This test uses today&#8217;s constituents, a longer sample and weights applied only to the days after each fit, and the result reversed. This test doesn&#8217;t isolate which of those differences caused the change. One likely factor is the objective: TEVM fits the daily differences that tracking error measures, while the cointegration method fits price levels.<\/p>\n\n\n\n<h2 id=\"h-what-would-change-these-results\" class=\"wp-block-heading\">What would change these results<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Several choices in this test affect the outcome, and each is worth varying before drawing a firm conclusion:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Survivorship. The test uses the constituents returned on the day of the run, applied back to 2010. Companies that left the index during that time aren&#8217;t in the portfolios, which likely makes both of them look better than a real-time version would.<\/li>\n\n\n\n<li>Critical values with many stocks. The calibration windows all showed stationary residuals with a standard ADF test, but with 33 regressors the proper Engle-Granger critical values are much stricter than the standard ADF ones. That share overstates how often the full portfolio was cointegrated.<\/li>\n\n\n\n<li>Weights. The regressions don&#8217;t restrict the weights, so some can be negative, which means short positions. A long-only version needs a constrained optimization instead of plain OLS.<\/li>\n\n\n\n<li>Window and rebalancing. A 500-day window and a 10-day rebalance follow the original article. Longer windows give more stable weights, and less frequent rebalancing lowers trading costs, which this test doesn&#8217;t include.<\/li>\n\n\n\n<li>Number of stocks. Many tracking portfolios use only a subset of the constituents. With fewer stocks, the difference between the two methods can change.<\/li>\n<\/ul>\n\n\n\n<h2 id=\"h-conclusion\" class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Engle-Granger cointegration test is a two-step check: regress one price series on another, then test the residuals for a unit root. On 16 years of DAX data, only Allianz passed it at the 5% level against the index. Over long periods, a single stock rarely keeps a stable link with a broad index.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For index tracking, both approaches built portfolios with a correlation above 0.99 to the DAX. In this out-of-sample test, the TEVM portfolio tracked the index more closely than the cointegration portfolio, with a tracking error of 2.04% against 2.61%.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With the EODHD end-of-day and fundamentals data, you can rerun the test on other indices, windows and subsets of stocks. For the endpoints used here, see the <a href=\"https:\/\/eodhd.com\/financial-apis\/api-for-historical-data-and-volumes\" target=\"_blank\" rel=\"noreferrer noopener\">End-of-Day Historical Data API documentation<\/a> and the <a href=\"https:\/\/eodhd.com\/financial-apis\/stock-etfs-fundamental-data-feeds\" target=\"_blank\" rel=\"noreferrer noopener\">Fundamentals API documentation<\/a>.<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><a class=\"maxbutton-1 maxbutton maxbutton-subscribe-to-api external-css btn\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/eodhd.com\/register\"><span class='mb-text'>Register &amp; Get Data<\/span><\/a><\/p>\n\n\n\n<h2 id=\"h-faqs\" class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Q: What is the Engle-Granger cointegration test?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is a two-step test for a long-run relationship between non-stationary series. First, regress one series on the other with OLS. Second, test the residuals for a unit root with an ADF test. Stationary residuals mean the series are cointegrated.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Q: How do I run the Engle-Granger test in Python?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use statsmodels.tsa.stattools.coint(y, x) on the price levels or log prices. It returns the test statistic, the p-value and the 1%, 5% and 10% critical values, and applies the critical values that the Engle-Granger test requires.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Q: What is the difference between cointegration and correlation?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Correlation measures how closely returns move together. Cointegration means the price levels share a long-run equilibrium, so the spread between them keeps returning to its average. Two series can be highly correlated without being cointegrated.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Q: What is the difference between the Engle-Granger and Johansen tests?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Engle-Granger tests one relationship at a time and depends on which variable is the dependent one in the regression. Johansen tests several series together and can find more than one cointegrating relationship.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Q: Which is better for index tracking, cointegration or tracking error minimization?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It depends on the setup. In this test on the DAX from 2012 to 2026, the TEVM portfolio had a lower out-of-sample tracking error (2.04%) than the cointegration portfolio (2.61%), and ended with a cumulative gap of 0.97% to the index.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Engle-Granger cointegration test checks whether two or more non-stationary price series share a long-run equilibrium. It runs in two steps: an OLS regression of one series on the other, then a unit root test on the residuals. If the residuals are stationary, the series are cointegrated, which means the gap between them keeps returning [&hellip;]<\/p>\n","protected":false},"author":36,"featured_media":4799,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[65,77,48],"tags":[],"coding-language":[],"ready-to-go-solution":[],"qualification":[],"financial-apis-category":[],"financial-apis-manuals":[],"class_list":["post-7184","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backtesting-strategies-examples","category-portfolio-performance-examples","category-stocks-data-processing-examples","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.9 (Yoast SEO v26.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Engle-Granger Cointegration Test in Python: DAX Example<\/title>\n<meta name=\"description\" content=\"How the Engle-Granger cointegration test works, with Python code on 16 years of DAX data, and how cointegration and TEVM tracking compare.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Engle-Granger Cointegration Test in Python: Benchmark Tracking on the DAX\" \/>\n<meta property=\"og:description\" content=\"How the Engle-Granger cointegration test works, with Python code on 16 years of DAX data, and how cointegration and TEVM tracking compare.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python\" \/>\n<meta property=\"og:site_name\" content=\"Financial Academy\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/eodhistoricaldata\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-01T11:00:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-10T06:44:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/02\/newplot-2024-02-01T115027.672-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"856\" \/>\n\t<meta property=\"og:image:height\" content=\"525\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Kevin Meneses Gonz\u00e1lez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EOD_data\" \/>\n<meta name=\"twitter:site\" content=\"@EOD_data\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kevin Meneses Gonz\u00e1lez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python#article\",\"isPartOf\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python\"},\"author\":{\"name\":\"Kevin Meneses Gonz\u00e1lez\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/f085666760ee7f148d1923a296cf3fe3\"},\"headline\":\"Engle-Granger Cointegration Test in Python: Benchmark Tracking on the DAX\",\"datePublished\":\"2024-02-01T11:00:07+00:00\",\"dateModified\":\"2026-11-10T06:44:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python\"},\"wordCount\":1729,\"publisher\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#organization\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python#primaryimage\"},\"thumbnailUrl\":\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/02\/newplot-2024-02-01T115027.672-2.png\",\"articleSection\":[\"Backtesting Strategies Examples\",\"Portfolio Performance Examples\",\"Stocks Data Processing Examples\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python\",\"name\":\"Engle-Granger Cointegration Test in Python: DAX Example\",\"isPartOf\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python#primaryimage\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python#primaryimage\"},\"thumbnailUrl\":\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/02\/newplot-2024-02-01T115027.672-2.png\",\"datePublished\":\"2024-02-01T11:00:07+00:00\",\"dateModified\":\"2026-11-10T06:44:21+00:00\",\"description\":\"How the Engle-Granger cointegration test works, with Python code on 16 years of DAX data, and how cointegration and TEVM tracking compare.\",\"breadcrumb\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python#primaryimage\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/02\/newplot-2024-02-01T115027.672-2.png\",\"contentUrl\":\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/02\/newplot-2024-02-01T115027.672-2.png\",\"width\":856,\"height\":525,\"caption\":\"cointegration analysis\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/eodhd.com\/financial-academy\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Engle-Granger Cointegration Test in Python: Benchmark Tracking on the DAX\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#website\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/\",\"name\":\"Financial APIs Academy | EODHD\",\"description\":\"Financial Stock Market Academy\",\"publisher\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/eodhd.com\/financial-academy\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#organization\",\"name\":\"EODHD (EOD Historical Data)\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png\",\"contentUrl\":\"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png\",\"width\":159,\"height\":82,\"caption\":\"EODHD (EOD Historical Data)\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/eodhistoricaldata\",\"https:\/\/x.com\/EOD_data\",\"https:\/\/www.reddit.com\/r\/EODHistoricalData\/\",\"https:\/\/eod-historical-data.medium.com\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/f085666760ee7f148d1923a296cf3fe3\",\"name\":\"Kevin Meneses Gonz\u00e1lez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/19dee2010941996b1cce342ad66f6964baa6eac898570992e3cddc1b00143a79?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/19dee2010941996b1cce342ad66f6964baa6eac898570992e3cddc1b00143a79?s=96&d=mm&r=g\",\"caption\":\"Kevin Meneses Gonz\u00e1lez\"},\"description\":\"Kevin Meneses Gonz\u00e1lez is a CRM consultant and technical content creator focused on Python, AI, and financial data. He writes practical tutorials on using APIs and automation to analyze markets and build investment research tools.\",\"sameAs\":[\"https:\/\/kevinmeneses.com\/en\",\"https:\/\/www.linkedin.com\/in\/kevin-meneses-gonzalez\/\",\"https:\/\/www.youtube.com\/@pythonia6131\"],\"url\":\"https:\/\/eodhd.com\/financial-academy\/author\/kevinmeneses\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Engle-Granger Cointegration Test in Python: DAX Example","description":"How the Engle-Granger cointegration test works, with Python code on 16 years of DAX data, and how cointegration and TEVM tracking compare.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python","og_locale":"en_US","og_type":"article","og_title":"Engle-Granger Cointegration Test in Python: Benchmark Tracking on the DAX","og_description":"How the Engle-Granger cointegration test works, with Python code on 16 years of DAX data, and how cointegration and TEVM tracking compare.","og_url":"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python","og_site_name":"Financial Academy","article_publisher":"https:\/\/www.facebook.com\/eodhistoricaldata","article_published_time":"2024-02-01T11:00:07+00:00","article_modified_time":"2026-11-10T06:44:21+00:00","og_image":[{"width":856,"height":525,"url":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/02\/newplot-2024-02-01T115027.672-2.png","type":"image\/png"}],"author":"Kevin Meneses Gonz\u00e1lez","twitter_card":"summary_large_image","twitter_creator":"@EOD_data","twitter_site":"@EOD_data","twitter_misc":{"Written by":"Kevin Meneses Gonz\u00e1lez","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python#article","isPartOf":{"@id":"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python"},"author":{"name":"Kevin Meneses Gonz\u00e1lez","@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/f085666760ee7f148d1923a296cf3fe3"},"headline":"Engle-Granger Cointegration Test in Python: Benchmark Tracking on the DAX","datePublished":"2024-02-01T11:00:07+00:00","dateModified":"2026-11-10T06:44:21+00:00","mainEntityOfPage":{"@id":"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python"},"wordCount":1729,"publisher":{"@id":"https:\/\/eodhd.com\/financial-academy\/#organization"},"image":{"@id":"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python#primaryimage"},"thumbnailUrl":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/02\/newplot-2024-02-01T115027.672-2.png","articleSection":["Backtesting Strategies Examples","Portfolio Performance Examples","Stocks Data Processing Examples"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python","url":"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python","name":"Engle-Granger Cointegration Test in Python: DAX Example","isPartOf":{"@id":"https:\/\/eodhd.com\/financial-academy\/#website"},"primaryImageOfPage":{"@id":"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python#primaryimage"},"image":{"@id":"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python#primaryimage"},"thumbnailUrl":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/02\/newplot-2024-02-01T115027.672-2.png","datePublished":"2024-02-01T11:00:07+00:00","dateModified":"2026-11-10T06:44:21+00:00","description":"How the Engle-Granger cointegration test works, with Python code on 16 years of DAX data, and how cointegration and TEVM tracking compare.","breadcrumb":{"@id":"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python#primaryimage","url":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/02\/newplot-2024-02-01T115027.672-2.png","contentUrl":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/02\/newplot-2024-02-01T115027.672-2.png","width":856,"height":525,"caption":"cointegration analysis"},{"@type":"BreadcrumbList","@id":"https:\/\/eodhd.com\/financial-academy\/portfolio-performance-examples\/benchmark-tracking-and-cointegration-analysis-with-python#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/eodhd.com\/financial-academy\/"},{"@type":"ListItem","position":2,"name":"Engle-Granger Cointegration Test in Python: Benchmark Tracking on the DAX"}]},{"@type":"WebSite","@id":"https:\/\/eodhd.com\/financial-academy\/#website","url":"https:\/\/eodhd.com\/financial-academy\/","name":"Financial APIs Academy | EODHD","description":"Financial Stock Market Academy","publisher":{"@id":"https:\/\/eodhd.com\/financial-academy\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/eodhd.com\/financial-academy\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/eodhd.com\/financial-academy\/#organization","name":"EODHD (EOD Historical Data)","url":"https:\/\/eodhd.com\/financial-academy\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/logo\/image\/","url":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png","contentUrl":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png","width":159,"height":82,"caption":"EODHD (EOD Historical Data)"},"image":{"@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/eodhistoricaldata","https:\/\/x.com\/EOD_data","https:\/\/www.reddit.com\/r\/EODHistoricalData\/","https:\/\/eod-historical-data.medium.com\/"]},{"@type":"Person","@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/f085666760ee7f148d1923a296cf3fe3","name":"Kevin Meneses Gonz\u00e1lez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-academy\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/19dee2010941996b1cce342ad66f6964baa6eac898570992e3cddc1b00143a79?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/19dee2010941996b1cce342ad66f6964baa6eac898570992e3cddc1b00143a79?s=96&d=mm&r=g","caption":"Kevin Meneses Gonz\u00e1lez"},"description":"Kevin Meneses Gonz\u00e1lez is a CRM consultant and technical content creator focused on Python, AI, and financial data. He writes practical tutorials on using APIs and automation to analyze markets and build investment research tools.","sameAs":["https:\/\/kevinmeneses.com\/en","https:\/\/www.linkedin.com\/in\/kevin-meneses-gonzalez\/","https:\/\/www.youtube.com\/@pythonia6131"],"url":"https:\/\/eodhd.com\/financial-academy\/author\/kevinmeneses"}]}},"jetpack_featured_media_url":"https:\/\/eodhd.com\/financial-academy\/wp-content\/uploads\/2024\/02\/newplot-2024-02-01T115027.672-2.png","jetpack_shortlink":"https:\/\/wp.me\/pdOdVT-1RS","jetpack_sharing_enabled":true,"acf":[],"_links":{"self":[{"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/posts\/7184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/users\/36"}],"replies":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/comments?post=7184"}],"version-history":[{"count":2,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/posts\/7184\/revisions"}],"predecessor-version":[{"id":7188,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/posts\/7184\/revisions\/7188"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/media\/4799"}],"wp:attachment":[{"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/media?parent=7184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/categories?post=7184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/tags?post=7184"},{"taxonomy":"coding-language","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/coding-language?post=7184"},{"taxonomy":"ready-to-go-solution","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/ready-to-go-solution?post=7184"},{"taxonomy":"qualification","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/qualification?post=7184"},{"taxonomy":"financial-apis-category","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/financial-apis-category?post=7184"},{"taxonomy":"financial-apis-manuals","embeddable":true,"href":"https:\/\/eodhd.com\/financial-academy\/wp-json\/wp\/v2\/financial-apis-manuals?post=7184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}