Common Mistakes In Quantified Trading (Quantitative Trading)
Last Updated on October 23, 2022
Automated trading has an almost endless list of issues that can turn your trading into a disaster. For automated traders, you face another issue in addition to the technicalities of trading: screw-ups with software and programs.
Automated trading has many advantages, but the main advantage is the potential mistake of the program sending many wrong orders. It can happen, unfortunately.
Thus, trading is about avoiding mistakes. How do you avoid mistakes? The most important thing is to run a checklist every day. Airline pilots “invented” the checklist almost 100 years ago – something that has made flying an extremely safe means of transportation. You can make your trading just as safe by implementing checklist procedures.
Trading involves anticipating the unexpected
Randomness is a big part of trading. The loopholes in the development process are many: underestimating commissions and slippage, curve fitting, and survivorship bias are elements many ignore or underestimate. Creating, building, and developing strategies is no easy task, and you are not out of the woods when you believe you have found a tradeable strategy.
What you do when you are trading an automated strategy live is just as important. Unfortunately, a lot of things can go wrong:
Trading is all about avoiding costly mistakes
I’m mostly an automated trader. This gives me opportunities to trade and diversify easily. But with automation comes a risk if something goes wrong.
Chapter 4 in Victor Niederhoffer’s book Education Of A Speculator starts like this:
There are so many ways to lose, but so few ways to win. Perhaps the best way to achieve victory is to master all the rules for disaster and then concentrate on avoiding them.
Some days ago I wrote about my trading day and my procedures. For me, it’s extremely important to do everything in the correct order/procedure. This is to avoid costly mistakes.
Do you remember Knight Trading? They updated their robot and forgot to test it. Too bad for them, the program went crazy and sent a lot of erroneous sell orders. They pushed prices down and they didn’t manage to stop until they had lost about 500 million USD. This created a lot of prey for individual day traders like me. It was a very good day. Unless, of course, you’re not the one being preyed upon!
Automated and quantified trading requires procedures and checklists
With automation, it’s extremely important to do things in the correct order and to make sure all programs are set correctly before the market opens.
To avoid mistakes I need to follow my procedures, just like airline pilots. There is a reason why pilots need to follow every procedure: one mistake can lead to a crash. Pilots have checklists, something both traders and investors should have:
It’s the same with automation. One mistake and you risk losing your account. I never want to rush anything when preparing for the trading day. I have fellow traders who have lost 100 000 in seconds just because of fat-finger errors. I try to make all kinds of bells and whistles to make sure all is correct.
What kind of procedures do I need to do? All of these are very tedious and boring. But I want to avoid them at all costs. Everything that can potentially go wrong, will sooner or later go wrong, it’s just a question about time.
The “unsinkable” Titanic relates to trading
I remember the “unsinkable” Titanic. Niederhoffer had a picture of Titanic on his desk, but that didn’t help him from closing down his hedge fund in 1997.
Before every trading day I need to do the following: check for correct closing prices in my trading software, all formulas must be correct and tickers with news must be removed. After that, I send just a small sample and calculate it manually. I can assure you the following: if anything can go wrong in automation, a serious mistake will happen sooner or later. It’s just a question of time.
Typical trading mistakes for automated traders:
What are the typical mistakes automated traders do? Below is a random sample of my own trading mistakes over the years:
Being in a hurry:
Before Christmas, I had problems updating my quotes right after the open. I had to restart my Excel sheet, but in the hurry, I forgot to exclude news stocks (I don’t trade news). That cost me 1 000 USD. Not a great amount, but nevertheless unnecessary. This happened because my procedures were disturbed and I was in a hurry.
Now, let me tell you what happened to a trading colleague. He is still a little wet behind his ears and does not have much experience.
In January he started trading a new strategy, fully automated. The strategy requires a lot of calculations, and he failed to double-check calculations in his code manually. Result: Limit prices were completely off and of course led to losses. It was a huge mistake but he was lucky and lost only 500 USD. This error could have cost him tens of thousands of dollars.
Did he learn from this mistake? Unfortunately not. Three weeks later it happened again:
Small mistakes compound:
This time he made some changes to an already existing strategy. Unfortunately, in coding, he typed “2” instead of “1” in one place. Result: hundreds of orders were sent short instead of long. Again he was extremely lucky and only lost 700. The loss could have been 50 000.
This is why it’s so important to double-check all code after any changes and test on a small sample before using the whole sample of stocks.
Just 4 days after this a new error occurred: When closing down trading for the day some 30 mins before close, he was unaware a lot of orders were still in the market. Of course, he got filled on some of those and lost 300 USD.
Yet again, extremely lucky to not lose more. Lesson: always log out and in to double checks all is ok.
And think long-term. mistakes compound, and opposite learning and experience compound, as explained in Thinking In Bets.
Not double-checking calculations:
In my EOD trading, I have also done some mistakes: for two weeks I accidentally had a calculation error in my sheets. I of course lost money before I realized what was wrong. I send a lot of orders overnight and use an Excel macro to close them. Even after double-checking manually, I didn’t spot this formula error in my spreadsheet.
Quantified traders need bookkeeping
Make sure you have a journal so you can keep track of your trades and mistakes. By doing so, you can continually update your trading checklist. Read this article for a trading journal example.
Conclusion: Automated/quantified trading requires checklists
Unnecessary mistakes are a real drag on performance. During a year all these mistakes add up quite much. And some really serious mistakes can force you to stop trading altogether.
Moral: everything that can go wrong needs to be double-checked. And preferably before learning from mistakes! Always test on small samples first.
However, mistakes will inevitably happen, but you need to minimize them as much as you can. One step in the right direction is to install filters that somehow can stop erroneous orders.
I would make a “filter” in the automated program that controls all new orders. It is like a function/module (don’t know the correct terminology) that approves/disapproves each new order before it is sent to the broker.
You can set a limit to number of orders within one minute, size … anything you can imagine.
It should be easy to implement.
I use the neoticker platform for automated trading and i generally don’t run into problems like these however I have had trades executed on my the trading system that were never accepted my the broker’s api somehow (they went into la la land). Or on the biggest winning trade day of the year so far for 2014 for a particular system – esignal data went down for most of the day and i did not have aback up and because the system was automated I did not notice right away. Missed that trade.
Or one time I got sloppy and when the broker was changing clearing firms I thought I could switch my account funds to the new clearing firm faster that I thought (the broker did not make it easy) and in the day i was down I missed what turned out to be the largest system trade of 2013.
I reboot my trading PCs every morning in early AM, I then have automated procedures (macros) that completely start my systems automatically – one feature I would like to add but I need to learn to program is to send my cell a text message notification for when a trade is executed so I don’t miss anything. I do not watch my automated systems all day but check in on things several times a day – I can also remote log into my trading PCs when I travel. Finally I have everything UPS backed up so if power goes out I can continue to function for approximately an hour before computer functionality is lost. Usually power goes out momentarily (I live in rural Iowa) or half hour at max.
I am not a professional trader. I recently listened to an interview by Michael Covel of Tom Basso who i respect alot an was a very successful CTA now retired – he went through his office procedures for their checks and balances that they employed to make sure everything was as planning – it was a valuable listen.
Thanks for the great information!
I am using a java based programm to send my buy-orders via the interactive brokers api during the day, when a drop in stock price is detected (as I am working full time and to don’t have a chance to check all day). I will sell the stocks by hand at the close or if I feel I am overweight in some stocks I also might sell them prematurely.
I have some checks in the software, that regularly check the account size, the number of open orders, the numbers of trades made… to detect any irregularities and then stop trading. Fortunately nothing seriously bad has happend yet, eventhough I also detected some errors in my code. I check if everything is running smoothly multiple times per day if possible.
The thing I am more afraid of is the possibility of some kind of crash with me being heavy invested. As I am also a “mean reversion – only long” – trader the possibility of a serious drawdown is always on my mind. Oddmund, as I read you don’t use stops (same as me), do you use some hedging (f.e. like shorting SPY) when you are heavily invested ?
Hi, yes i use hedging when I’m “too much” long or short. My threshold is about 100 000 USD. If I’m net that amount long or short then I use IWM and SPY as a hedge.
Ugh! I have heard of people having similar issues like these! There has never been a better example to double or triple check your numbers!!
Well, I guess if you lose 500 million USD you’ll have a strong motivation to recover the money back and why not making some profit after that! Of course that you have to recover the money in the same way you have lost them (massively), because in other way 500 million USD it is a large amount of money.