AmiBroker, AI, and why starting ugly is the whole point
StatsEdgeTrading
We did a little follow-up on Line Your Own Pockets because my AmiBroker journey is officially in the “slog” phase. You know the phase: everything takes longer than it should, half your questions get answered with confident nonsense, and every backtest feels like you pressed a button that says go make coffee for an hour.
And honestly, that’s the point.
If you’re trying to automate trading, the goal is not to have AI hand you a magic strategy. The goal is to build a process that turns a clean idea into code you understand, can validate, and can iterate on without creating AI slop spaghetti code.
Here’s what’s working for me:
Give the LLM a real template, not vibes
The biggest unlock is feeding ChatGPT an actual working AFL script so it understands syntax, structure, and the way AmiBroker expects things. Once it has a “this is correct” reference, it stops defaulting to random Python-brain outputs.Make it teach you like you are five
I literally force it to explain every line. What does this do, why is it here, what does it break if we remove it. That’s how you learn enough to catch lies. You don’t need to become a full-time programmer. You need to know when something does not make sense.Start with simple strategies on purpose
A clean opening range breakout is perfect. Simple code. Easy chart spot-checking. And the idea is mechanically true: if a stock trends intraday, it breaks its opening range at some point. The edge comes from the rules around it, not the concept.Build a library, not a pile of copy-pastes
The long-term play is reusable building blocks: columns, filters, conditions, and reusable functions. Fix one bug in the library and every strategy improves. Copy-paste is how you create fragile systems you are afraid to touch.Speed matters because iteration matters
If your AmiBroker backtest takes an hour no matter what, you need workflow tricks: run smaller symbol sets, export symbol lists to watchlists, or build a smaller database for quick iteration. Backtesting slow forces intentionality, but you still need a fast sandbox.
If you want more of this behind-the-scenes systematic trading talk, plus the free newsletter and free trading courses, head to www.statsedgetrading.com.

