Here’s a good question from long-time list member, Matt H (name used with permission), on simulating real-world executions in a backtest for his strategy in Amibroker.
Matt H:
I have a different AmiBroker question. I spent many hours trying to get this to work, but have not been successful yet.
I know you prefer to have a single entry and exit, but for my current strategy, for the sake of trying to capture liquidity, I need to have several buy and sell locations per symbol.
The first entry position size was properly calculated and entered correctly, but no matter if I pre-calculated an array for the order size (based on candle volume) or calculated the position size inside the for loop, the subsequent entries were oversized and uncorrelated to volume.
Dave:
You’re absolutely right that my default is to have a single entry and exit in my backtests.
The reason for that is important: it keeps your backtest simple.
Backtesting is daunting for a lot of traders already.
But it is so key to creating consistently profitable strategies – that’s where your valuable insights will come from.
Your backtesting process should be as streamlined as possible, so you can get better at this skill by getting a lot of reps.
The more complicated your backtesting process, the less you’ll end up doing it, so the fewer profitable insights you’ll create for yourself over time.
Modeling execution (which is what Matt’s describing) is a rabbit hole to avoid.
Does that mean you should ignore the differences between your backtest and execution?
No, but understand that any modeling of execution in your backtest is going to be imperfect and totally guessing.
And always one step away from a more “complete picture”, e.g. “if I only include NBBO data” turns into “if I only include Level 2 data”.
A classic rabbit hole requiring a lot of work and resources for minimal benefit.
Tomorrow, I’ll share a minimalist approach for getting almost all the benefits while keeping your backtest as simple as possible.
Thanks for the question, Matt!
-Dave