Thinking Stuff's ATM

Automated Trading Machine (ATM) makes it simple to remove fear and greed from your trading. Automated trading is no longer just for the rich or nerdy. Our revolutionary software runs on your computer, using your trading rules, but none of your emotions. There's just one requirement - you know how to use a mouse.  Learn more...

Thinking Stuff's ATE

Automated Trading Execution (ATE) is where we run your trading systems for you on our servers. Your system can be exported from ATM, or written in plain English and we'll make it for you. We'll even backtest and suggest improvements if you want us to. This service essentially automates your automated trading.  Learn more...

Thinking Stuff's Groups

Join a group of like-minded individuals, and help each other to trading success. Once you join a group, you will have access to that group's trading systems, ideas, and feedback. And please contribute your own knowledge as much as possible. Or contact us to start your own group.  Learn more...

Pessimistic Backtesting Results

ATM cannot get around the issue of opening and closing trades in the same bar.

All you know about the price movement in any given bar is the Open, High, Low, and Close. That's it. You have a zero percent chance of knowing exactly what the price did between those extreme points.

As you use longer and longer intervals, such as Hourly, Daily, Weekly, etc, you lose more and more information about what the price did during the bar. Assumptions have to be made during backtesting, and the biggest assumption is this: if your entry price and stop loss price both fit within the range of a bar, we have to assume the worst. That is, the price went up far enough to get us in the trade, and then fell back far enough to take out our stop loss.

A so-called "pessimistic trade".

We want to use the results of backtesting to proceed with confidence that our trading system is going to work in the real world. And therefore pessimistic results during backtesting are going to be better for our bank balance than if it gave overly optimistic results. It's better to be pleasantly surprised during real trading that the system work better than you thought, rather than getting a nasty shock.

And so in ATM, whenever one of these pessimistic trades happens, we simply note it in the summary. If the percentage of pessimistic trades compared to the total trades is very high, then the backtesting results can't really be relied upon. If however there are no, or very few, pessimistic trades, then you can be confident with the backtesting results.
 

The Workaround

Just as the longer the interval the less detail we have, so too the shorter the interval the more detail. Edit the backtest and choose a shorter interval to step through. 1-Second bars are the lowest. That's pretty close to working with tick data. You might be satisfied with 1-Minute or 5-Minute intervals though.

But there's a problem with this, too. Time, and space. Certainly, the lower the interval, the more accurate the backtest. But also the lower the interval, the more bars to process. The more bars to process, the longer it takes to finish a backtest.

It also means that you need to create all those 1-Second bars, which adds extra time, and takes extra space on your computer.

At some point there is equilibrium between the accuracy and the time it takes. But is that equilibrium at 1-Second, 5-Minute, or Hourly bars? That all depends on your trading system and your computer's speed. If you want to test with 1-Second bars, just make sure you do a test run with only 3 hours' worth of prices (~10,000 bars) before running a test over weeks of prices.
 

Groups: