Skip to content
Dave Mabe
Close menu

"How do you account for spread with AmiBroker?"

By Dave Mabe

Here's a good question from a long-time list member and Trade-Ideas user who is starting to backtest in AmiBroker and wishes to remain anonymous:


Anonymous:

How do you account for spread with AmiBroker?


Dave:

This is a common scenario for traders who use Trade-Ideas.

TI has a spread filter that comes in handy in certain situations.

When they come to AmiBroker to backtest, they realize spread isn't included in the OHLC bar data they backtest with.

Is this a cause for concern? No.

Most traders who use it in a strategy in TI are combining two separate concepts:

  • Strategy development

  • Execution

The bid/ask spread is extremely transient and highly variable.

The spread alone shouldn't be applied as a rule to most strategies to improve their edge.

(There are exceptions, but in this trader's context, they don't apply.)

For example, on a fast-moving stock, you'll often see the spread widen briefly, then quickly return to "normal."

In most cases, the brief widening doesn't strongly affect the strategy.

If it does, your strategy might not be doing what you think it is.

In other words, thinking about the spread should fall under execution rather than strategy development.

Many Trade-Ideas users use spread as a proxy for something they don't realize: a minimum liquidity filter.

And there are plenty of ways to apply a perfectly good liquidity floor in your strategy using bar data without the spread.

Getting caught up on execution issues too early in your process is a form of premature optimization.

Great question - thanks for sharing with the group.

-Dave

P.S. Are you missing short trades in hard-to-borrow names? Get lightning-fast, automated locates using the Trade Client with MabeKit. Get Instant Access