3 ms·
Trading the right instruments is crucial. Pick highly leveraged instruments with low competition and liquidity. Trading big instruments like USDEUR is pointless
by thcsa 9y ago
Trading the right instruments is crucial. Pick highly leveraged instruments with low competition and liquidity. Trading big instruments like USDEUR is pointless unless 1) you have the right infrastructure or 2) you are a genius, since competition is incredibly high there. But there are small instruments out there where I (not a genius) easily make a 1500% annual return on $10k. However, give me $100m and I'll make less than 0.25% a year, because liquidity is low and orderbooks are thin.
Considering the trading system itself, I think what makes my system pretty neat is that I can backtest on Level 2 data. Level 2 data basically means information about the order book (and not just the top bid/ask). I collected L2 data for specific instruments for months. So if someone posted a limit buy order on instrument X with amount Y 0.54% below the top bid on October 15th, 21:01:13.746Z and canceled it 4287 milliseconds later - I have that information. Now the cool thing is that I can 'replay' everything, which basically allows me to know how the structure of the whole order book was at any time. This allows you to do pretty accurate backtesting, since you know the exact execution price of your market orders (market orders = orders that take liquidity from the book). Coding that was probably the hardest challenge, since performance matters for backtesting (for trading, it depends on the instrument and the strategy - for me, it doesn't matter a lot). You need to have a good design. Gladly, Kotlin makes concurrency a breeze with coroutines, so I basically have one routine for each instrument (which has to process order book messages sequentially for obvious reasons).
I am currently working on a machine learning approach to detect buy and sell pressure based on changes in the order book structure. Order placement (depending on the instrument) involves a lot of 'playing games', so people bait, people spoof, people try to push the orderbook down or up etc. I naively threw some pre-engineered features on a couple of LSTM layers, but results were not outstanding. But I think that this approach has some potential if executed properly.
EDIT: Obviously this is not my first coding project. My first 'project' was about autocompleting words. I used a trie structure for that, every node (letter) had a treemap of its child nodes, sorted by the occurences. So in the end I was reading a huge data set into my program, which had millions of hashmaps and other objects floating around, eating up 9 gigs of RAM :D. This was on desktop for obvious reasons, I never had plans to code a app. Fun times.