SShortSingh.
Back to feed

Backtesting International ETF Premiums in Python Using Point-in-Time Data

0
·3 views

An international ETF backtest can show tight premium convergence even when simulated trades lose money, often because of a moving reference value or because a quote or FX update reached the exchange before it reached the strategy. The article recommends recording event and receipt timestamps so each decision only sees data available at its cutoff, and checking data age against limits. It also stresses recording whether FX is quoted as foreign currency per dollar, since the reciprocal is needed to convert values. A synthetic Python fixture separates the fair-value estimate, the premium signal, and short-position P&L, and shows a narrow displayed premium can coexist with a trading loss. The example is built on synthetic data covering one unhedged currency exposure with a single local-currency equity proxy.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Google's site: search returns empty results for pages it has indexed

Since around 19 November 2026, searching Google with site: plus a page's full address often returns nothing, even for pages that are indexed. Before that change, the same search usually displayed the page. A developer running a bulk index checker found that about three in ten of 85 pages marked as not indexed were actually present when re-checked on 21 November. Results that do show a page remain reliable, but an empty site: response no longer proves a page is missing. The author suggests searching the bare URL without the operator and repeating the query before concluding a page is not indexed. Google has not explained the change, and it is unclear whether it is limited to certain markets.

0
ProgrammingDEV Community ·

AWS IMDSv2 Architecture Explained: How Session Tokens Help Block SSRF Attacks

The Amazon EC2 Instance Metadata Service gives running instances details about their environment, including temporary IAM credentials, which makes it a sensitive internal target. Server-Side Request Forgery flaws can let attackers reach this endpoint from inside an application. AWS introduced IMDSv2 to make such attacks harder by requiring a session token obtained through a PUT request before metadata can be read. The token has a configurable lifetime of one second to six hours and is sent in a header with subsequent requests. The article also covers enforcing IMDSv2 at scale using AWS CLI, Terraform, and Service Control Policies.

0
ProgrammingDEV Community ·

Complex branching in pull requests linked to 29% higher agent review token costs

A developer found that their monthly AI agent review bill for a Node service rose about 18% while pull request volume stayed roughly flat. Referencing a study of 465 open source pull requests that tied low code health to 22-35% higher inference costs, they examined 36 merged pull requests from their own service. Using a crude proxy counting branching constructs in added lines, they compared the most branch-dense third of changes against the least. The densest third consumed about 29% more input tokens per changed line, a result within the range the larger study reported. The author cautions that this small single-service sample is not a rigorous confirmation of the effect.