December 21, 2022

Market Depth HFT Trading strategy with Machine Learning (Part II)

In the previous post, I described a system for trading a 1-second resolution DOW30 index based on market depth and machine learning, It showed potential for profit so I kept digging to review how can I take this further.

Following requests and comments from readers, I made some changes to test the validity of the system (backtest, for now , live trading will be implemented soon)

The first thing I did was to trade on a 24 hours cycle, meaning train the machine on early data then test it on later data, and start the process fresh every day, another change was to review the effect of the train data length, I started the test data length to be 10% of the sample set then increased to 90% of the sample set and the results are a surprise, see below.

Here is one of the better days for trading the strategy :

The backtest includes transaction costs.

Regarding the test data length, I have been saying for some time that training a machine is not in the quantity but in quality, if you feed a prediction model with millions of samples that are unrelated and noisy, the prediction will be noisy and of low quality (Often called garbage in – garbage out),
but if the model receives 1000 samples of high quality, it will produce high-quality results ,

This is a graph showing the performance of the strategy per test size (remember – a large test size is a smaller train size)

As you can see, the higher the test size (lower train size), the better the results,

This is because the larger the training dataset the more confusion there is for the prediction model, clarity comes in the smaller data sample size, especially in noisy datasets like price derivative data,

Trade smart,