Look‑Ahead Traps in Backtesting (Backtrader, MQL, PineScript)

Why This Matters If a backtest seems to “forecast” the future without any explanatory edge, it probably does. The culprit is usually look‑ahead bias: using information you could not have known at the time of the decision. Below are the most common categories, each with a tiny example and a safe fix. These patterns appear in Backtrader, MQL (MetaTrader), PineScript—really in every language and engine. 1) Using Future Bar Values Symptom: The strategy decides using the current bar’s final values (like Close) and assumes an execution that benefits from that same bar’s information. ...

December 19, 2025 · 4 min · Josep Oriol Carné

The Traveling Salesman Problem: From 19th Century Puzzles to Genetic Algorithms

A salesman must visit a set of cities exactly once and return home, minimizing total travel distance. This deceptively simple puzzle—the Traveling Salesman Problem (TSP)—has haunted mathematicians, computer scientists, and logistics planners for nearly two centuries. It remains one of the most studied problems in computational optimization. Historical Origins The TSP’s roots trace to the 1830s, when Irish mathematician William Rowan Hamilton and British mathematician Thomas Kirkman studied related mathematical problems involving traversing graph vertices. Hamilton created the “Icosian Game” in 1857, a puzzle requiring players to find paths visiting each vertex of a dodecahedron exactly once. ...

December 10, 2025 · 5 min · Josep Oriol Carné

Custom Claude Code Notifications on Linux

If you use Anthropic’s Claude Code CLI, you know the struggle: you run a complex prompt or a long refactoring task, switch to another task, and forget to check back for five minutes. I recently came across Andrea Grandi’s post on how to solve this on macOS using terminal-notifier. Linux has a native equivalent that works perfectly. So… here’s how to set up desktop notifications for Claude Code on Linux. The Linux Alternative: notify-send On macOS, Andrea used terminal-notifier. On Linux, the standard tool for sending desktop notifications is notify-send, which is part of the libnotify library. Installed in my lubuntu 24.04 by default. But, First, ensure you have it installed. ...

December 6, 2025 · 3 min · Josep Oriol Carné

The Red Queen Effect: Running as Fast as You Can Just to Stay in Place

“Now, here, you see, it takes all the running you can do, to keep in the same place. If you want to get somewhere else, you must run at least twice as fast as that!” This quote, spoken by the Red Queen in Lewis Carroll’s Through the Looking-Glass (1871), became one of the most influential metaphors in evolutionary biology—and increasingly, in technology. Origins: From Victorian Nonsense to Scientific Theory Lewis Carroll (Charles Dodgson) was a mathematics lecturer at Oxford when he wrote Through the Looking-Glass. The Red Queen scene depicts Alice running hand-in-hand with the chess piece queen across a landscape that moves beneath them. Despite exhausting effort, they remain in the same spot. ...

December 4, 2025 · 6 min · Josep Oriol Carné

My Go-To Prompt for Testing Local LLMs

Running local LLMs is kinda addictive. New model drops? Gotta try it. But here’s the thing—you need a quick way to check if a model’s actually thinking or just spitting out vibes. The Prompt Here’s my go-to sanity check: What is the number that rhymes with the word we use to describe a tall plant? That’s it. Dead simple. Why This Works It’s not about being hard. It’s about being consistent. The model needs to: ...

November 4, 2025 · 2 min · Josep Oriol Carné

How Survivorship Bias Is Costing You Money (And You Don't Even Know It)

How Survivorship Bias Is Costing You Money (And You Don’t Even Know It) Discover how survivorship bias—a cognitive trap born from WWII bomber analysis—distorts investment strategies, startup success rates, and trading decisions. Learn to see what’s missing. The Bullet Holes That Saved Thousands of Lives It’s 1943, and Allied bombers are getting shredded over Europe. Planes limp back to base riddled with bullet holes, and the top brass has a problem. Where do they add armor? The logical answer seems obvious—reinforce the areas with the most damage. ...

November 3, 2025 · 9 min · Josep Oriol Carné

Monthstalgia #2: Lands of Lore - Three Heroes, Same Castle, Zero Endings

Some games you finish. Some games finish you. And some games you play over and over, convinced that this time you’ll figure it out—only to end up in the exact same place, wondering if the problem is the game or the player. Lands of Lore: The Throne of Chaos (1993) was that game for me. ...

October 1, 2025 · 3 min · Josep Oriol Carné

Monthstalgia #1: Wyrm - The Book I Refuse to Reread

Welcome to Monthstalgia, a new monthly series where I dig into geeky things I remember fondly from the past. Books, games, software, obscure tech—anything that left a mark on my younger self. The catch? These are memories, not reviews. Some of these things I haven’t touched in decades. And sometimes, I’m keeping it that way on purpose. Wyrm (1998) by Mark Fabi There’s a specific category of books from your formative years: the ones you loved so intensely that you’re now terrified to reread them. ...

July 2, 2025 · 3 min · Josep Oriol Carné

Secure Network Architecture for Home-Based Trading & Server Ops

Introduction: Shielding Critical Infrastructure Running 24/7 operations from a home base – whether it’s autonomous trading algorithms or personal management applications – demands more than consumer-grade network hygiene. We’ll cover segmenting your network to contain threats, hardening the perimeter (your router), and securing the endpoints (your servers – be they Raspberry Pis, standard PCs running Ubuntu, or even renterprise gear like Dell or IBM servers you might have… acquired). The goal is maximizing uptime and integrity while minimizing exposure (and money expenditure). Network Architecture: Segmentation is Non-Negotiable A flat network where your trading rig, your blog server, your smart lightbulb, and your personal laptop all share the same broadcast domain is an invitation for disaster. One compromised IoT device could become a pivot point to critical systems. Segmentation limits the blast radius. ...

April 25, 2025 · 8 min · Josep Oriol Carné

Selecting an Open-Source DB for Financial Time Series

Choosing Your Data Engine: More Than Just Code When your algorithms depend on processing high-frequency data streams, or when you’re building ML models that need fast access to vast historical context, the time series database isn’t just a component – it’s the bedrock of your operation. A bottleneck here means missed opportunities, flawed analysis, or outright system failure. I’ve spent time evaluating the options because getting this wrong has consequences, especially when real capital or critical infrastructure is on the line. ...

April 6, 2025 · 8 min · Josep Oriol Carné