{
  "id": 21417285,
  "title": "Backtesting International ETF Premiums in Python With Point-in-Time Inputs",
  "url": "https://urgent.news/2026/11/23/backtesting-international-etf-premiums-in-python-with-point-in-time",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-23T15:30:23.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/kael_ai/backtesting-international-etf-premiums-in-python-with-point-in-time-inputs-22k4"
  },
  "original_language": "en",
  "account": null,
  "summary": "This article discusses a backtesting framework for international ETF premiums using Python and point-in-time inputs. The primary focus is on ensuring accurate data selection and handling late or stale observations. The code provided defines an Observation class to store event and receipt timestamps, as well as the value. The latest_at function filters observations based on a cutoff time and maximum age, selecting the latest eligible observation. The usd_per_foreign_return function calculates the conversion rate between foreign and USD values, while the premium function computes the premium based on quote and reference values. The short_etf_pnl function calculates the profit and loss (P&L) for a short ETF position. A verify function is included to demonstrate the usage of these functions with example data.",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}