TLDR: During simulated testing a glitch in my algo blew up the account, and it scarred me.
It's a common theme in this forum ( and elsewhere ) that day trading systems are difficult if not impossible. The simple patterns are taken up by the institutional quants and HFT's. The complex patterns that successful discretionary traders use are nearly impossible to program. I attempted to challenge this paradox
I theorized that there is a gap that I can take advantage of, it would have to meet these 3 criteria:
Too complex for the HFT's, the pattern would need to require more the microseconds to calculate and take advantage of, and also happen on a larger time scale.
Not so complex so that only a human brain can recognize, this needed to be an automated system. Also at a time scales that humans cant react too ( eg 5 second bars )
Not enough meat for the institutional quants to bother with. This would need to be a scalping strategy, where if your moving large amounts of money would not be worth exploiting. While the lions are hunting antelopes, I wanted to hunt mice.
I ended up with a support resistance strategy. 90% of my secret sauce was finding a way to accurately and systematically identify horizontal supports ( I'd say under graduate level math and statistics, with some fancy python stats models ). 10% of the secret sauce is how I trade the support resistance lines, nothing too special just slightly different then norm. Lastly I set my stops relative to volatility (arguably the most important part! )
The system was making 2 to 5 trades per day, with %65 percent win rate!. Backtesting was difficult since I essentially had to build from scratch a backtesting module . There was no intraday backtesting available in python that I knew of.
I used the tick date from FIO! FYI the tick data alone pays for the elite membership 10 times over. I mostly followed Kevin Daveys backtesting method ( out of sample, walk forward ). The results were promising, (70% to 150% returns!), but clearly those numbers are way to high and per the Davey method backtest alone should not be trusted.
I spent hours learning the IBKR api, I signed up for a trial feed from IQfeed for 5 second bars. Lots of post on FIO claim IQfeed is better the IBKR. (FYI pretty annoying that IQfeed doesn't give you access to their API documentation unless you pay extra ). Also IQfeed's bars come in with a 1 to 1.5 second delay (on average). My algo is not that sensitive, but man I assumed delay would be in milliseconds
Last week I went live with sim trading! Monday, Tuesday and Wednesday all winners. 3 to 5 trades perday, matched my back test! Made $150 in those 3 days (1 contract ). Slippage and commission was actually LESS then I anticipated based on the Davey method. I could see my Lamborghini!
Thursday, full crash, dozens of trades. My wife said my laptop just keeps saying 'order filled' and 'order cancelled', simulated account wiped out.
It took a few hours to look through hundreds of lines of code, log files and debuggers to find the glitch. I fixed the glitch and added a new safety net ( if PnL drops to low stop trading ).
However this spooked me, the Davey method mandates months of live testing.... But with 3 days of results matching backtest, part of me considered turning it on (with just 1 contract) and making some lunch money ( only risking $1000 in account ).
I have hundreds of lines of code, there are glitches somewhere I am sure. The fact that I had 3 successful days and a glitch that was intermittent and hard to reproduces scares me. I am a mechanical engineer, I do not code for a living.
But man the thought of putting 5k in the hands of code alone ( even with months if sim ) scares me. And a recurring theme in FIO is not to trade with scared money. 5k wont hurt me financially, but blowing away 5k because I screwed up an IF statement does!