Quantitative strategies on High Frequency Data - 2025

Author

Nihad Alili (466258) & Vikram Bahadur (4666547)

Published

January 25, 2025

Group 1 - Final Strategy - Pair Trading

Considering the NASDAQ index future price and S&P 500 index future price represent the same returns on short/long run. If there is any change it should be temporary and should return back to earlier spread. So pair tradindin with mean reverting looks promising.

We used mean reverting pair trading using previous day average closing price ratio based spread and sds (standard deviation) ratios of returns based spread. Initially we tried different combination of entry/exit parameters and found that parameters those fit very well for particular dataset does not mean to fit significantly for the different data set. This because of changes in trends/patterns between data due to course of time. So we decided to find the best parameters on weekly basis and use them to run the pair strategy for next week. So technically every weeks parameters shifted to next week. Therefore for any given data set pre condition becomes it must be more than one week and ultimately we don’t trade at all the very first week of any given trade.

Assumptions

  • do not trade first week of every quarter

  • do not use in calculations the data from the first and last 10 minutes of the session (9:31-9:40 and 15:51-16:00)

  • do not hold positions overnight (exit all positions 20 minutes before the session end, i.e. at 15:40),

  • do not trade within the first 25 minutes of stocks quotations (9:31-9:55), but DO use the data for 9:41-9:55 in calculations of signal, volatility, etc.

Parameters are

  • spread.name = 1 (average mean ratio based spread) or 2 (sd ratio based spread).

  • net.SR = net sharpe ratio based on net pnl.

  • m = multipler to form upper and lower limits of signal.

  • volat.sd = rolling volatility of spread based on 60, 90, 120, 150 or 180 minutes data.

We calculated these parameters on daily basis and analysis them weekly basis to select the best one as per maximum net SR ratio and saved every Friday. Further we moved these parameters to next week Monday morning and filled the whole week as minute data.

Sample parameters from 2024 Quarter 2 (in sample data) looks like

best_parameters_2024_q2

Entry/exit technique

Every minutes, parameter “spread.name” type 1 or 2 based value used as signal, parameter “volat.sd” used to define rolling standard deviation of signal and finally multipled with +/- parameter “m” to get the upper and lower limit. If signal crosses the upper limit we go short and vice versa as mean reverting is applied.

Strategy performance

Below graph represent net vs gross pnl for out of sample 2024 Q4.

g1_q4_2024

Group 1 - 2022-2024 quarterly results (In sample data)

X Quarter.Name Gross.SR Net.SR Gross.CR Net.CR Gross.cumP.L Net.cumP.L Av.ntrades Stat
1 2022_Q1 -0.0544624 -1.3356356 -0.1013886 -1.978188 -577.280 -14452.735 4.644068 -5.283512
2 2022_Q3 -0.2735316 -0.8866143 -0.5287689 -1.530431 -2837.795 -9247.564 2.166667 -3.404230
3 2022_Q4 3.7798816 2.5726020 12.4474066 7.098790 22419.653 14865.495 2.666667 19.159937
4 2023_Q2 6.9713478 5.2925002 44.5676697 27.486047 53970.728 40750.735 4.300000 101.903802
5 2023_Q4 4.2290601 2.8969007 27.1422746 14.412131 22088.172 14856.988 2.271186 38.890707
6 2024_Q1 2.5614741 0.8205267 4.8902179 1.070790 12773.703 3430.214 2.866667 1.319879
7 2024_Q2 0.8397483 -0.8141622 2.2668195 -1.552525 4840.637 -4716.803 2.933333 -2.408170

Group 1 - 2022-2024 quarterly results (Out sample data)

X Quarter.Name Gross.SR Net.SR Gross.CR Net.CR Gross.cumP.L Net.cumP.L Av.ntrades Stat
1 2022_Q2 3.786966 3.221686 13.739149 11.514675 37695.061 32126.32 1.932203 39.952187
2 2023_Q1 -0.924567 -1.937151 -1.647921 -2.635071 -6691.361 -13934.36 2.483333 -6.941720
3 2023_Q3 -2.309336 -4.301788 -3.232991 -3.877103 -15872.490 -28903.23 4.100000 -13.042394
4 2024_Q3 2.908354 2.192217 15.945108 10.916840 25111.430 18954.20 1.868853 32.117622
5 2024_Q4 2.431699 1.151158 8.872391 2.782567 17241.929 8063.59 2.754098 5.808217

Approaches undertaken

Group 2

Assumptions:

  • Don’t use the data in (9:31 - 9:40) and (15:51 - 16:00)

  • LEAVE ALL POSITIONS before the break starts (16:45 - 18:15). In order to have less volatility we leave 15 minutes not 10 minutes.

  • Ignore weekends positions since the market is closed (Fri, 16:00 - Sun, 18:00)

We used the different strategies including and excluding some assets. First of all, we tried based on pair trading using average closing price spread and standard deviation of returns based on spread dividing pairs by currencies(CAD&AUD) and metals(XAU&XAG). The results were not satisfactory.

Secondly, we used mean-reversion volatility breakout strategy using AUD and pair of commodities XAU&XAG. In AUD, we found best strategy using intersection of fast 30 SMA and 90 slow SMA and 100 volatility memory as a breakout and also multiplier of 1.25. In XAU&XAG, we used spread = XAU - XAG * mean (XAU/XAG) with parameters as 120 window standard deviation and 0.9 upper and lower threshold multipliers.

CAD has similar patterns with AUD but cointegration between these two assets was detected rarely, so It made it useless to probe a new strategy using these currencies. That is why we dropped CAD in our strategy in order to minimize the risk.

Group 2- 2022 first quarter results

gross SR net SR gross CR net CR gross cumP&L net cumP&L av.ntrades
-0.08796367
-0.3203243
-0.1287973
-0.4405723
-59418.29
-215532.6
4.611111

g2_q1_2022

In the first quarter of 2022, our strategy concluded with negative PnL due to high volatility and Its stat value is -2.3672.

Group 2 - 2022 third quarter results

gross SR net SR gross CR net CR gross cumP&L net cumP&L av.ntrades
1.00793395
0.7994004
 2.2682883
1.6832033
838372.21
661778.9
4.763441

g2_q3_2022 In the third quarter of 2022, our strategy concluded with profit and Its stat value is 10,9323.

Group 2 - 2022 fourth quarter results

gross SR net SR gross CR net CR gross cumP&L net cumP&L av.ntrades
-0.28367666
-0.4872866
-0.5528670
-0.9162963
-238877.84
-408326.5
4.901099

g2_q4_2022

In the 4th quarter of 2022, our strategy was unsuccesfull, so Its stat value is -5.5088.

Group 2 - 2023 Second quarter results

gross SR net SR gross CR net CR gross cumP&L net cumP&L av.ntrades
1.8115 1.5756 4.3407 3.6753 1243477.0309 1070183.7479 5.1556

g2_q2_2023

In the second quarter of 2023, our stratgey concluded with success and its stat value 25.6372.

Group 2 - 2023 Fourth quarter results

gross SR net SR gross CR net CR gross cumP&L net cumP&L av.ntrades
0.4194 0.1852 0.9724 0.4112 323969.7207 142276.2714 5.0444

g2_q4_2023

In the fiurth quarter of 2023, our strategy was successfull with 2.0388 stat value.

Group 2 - 2024 First quarter results

gross SR net SR gross CR net CR gross cumP&L net cumP&L av.ntrades
-0.1721 -0.4597 -0.4496 -1.0528 -103307.4365 -274562.6246 4.6957

g2_q1_2024 In the first quarter of 2024, our strategy concluded with negative PnL and Its stat value is -5,9118.

Group 2 - 2024 Second quarter results

gross SR net SR gross CR net CR gross cumP&L net cumP&L av.ntrades
1.1043 0.98689 1.8792 1.662 1670146.1874 1487773.1757 5.0326

g2_q2_2024 In the second quarter of 2024, our strategy concluded with positive PnL and Its stat value is 12.1413.

Group 2 - 2022-2024 quarterly results

quarter assets.group grossSR netSR grossCR netCR av.daily.ntrades grossPnL netPnL stat
2022_Q1 2 -0.0880 -0.3203 -0.1288 -0.4406 4.6111 -59418.29 -215532.6 -2.3672
2022_Q3 2 1.0079 0.7994 2.2683 1.6832 4.7634 838372.21 661778.9 10.9323
2022_Q4 2 -0.2837 -0.4873 -0.5529 -0.9163 4.9011 -238877.84 -408326.5 -5.5088
2023_Q2 2 1.8185 1.5756 4.3407 3.6753 5.1556 1243477.03 1070183.7 25.6372
2023_Q4 2 0.4194 0.1852 0.9724 0.4112 5.0440 323969.72 142276.3 2.0388
2024_Q1 2 -0.1721 -0.4597 -0.4496 -1.0528 4.6957 -103307.44 -274562.6 -5.9118
2024_Q2 2 1.1043 0.9869 1.8792 1.6620 5.0326 1670146.19 1487773.2 12.1413

Group 2 - out of sample data, strategy checking

In our strategy, we used mean-reversion volatility breakout strategy using AUD and pair of commodities XAU&XAG. In AUD, we found best strategy using intersection of fast 30 SMA and 90 slow SMA and 100 volatility memory as a breakout and also multiplier of 1.25. In XAU&XAG, we used spread = XAU - XAG * mean (XAU/XAG) with parameters as 120 window standard deviation with 0.9 upper and lower threshold multipliers.

CAD has similar patterns with AUD but cointegration between these two assets was detected rarely, so It made it useless to probe a new strategy using these currencies. That is why we dropped CAD in our strategy in order to minimize the risk. In our sample, we got 4 positive and 3 negative PnL, which made it actually high risky profitable strategy.

In out of sample data, we evaluated our strategy in 5 quarters and 2 quarter PnL resulted negatively and 3 quarters resulted positvely.

Goup 2 - 2022 second quarter results

grossSR netSR grossCR netCR av_daily_ntrades grossPnL netPnL stat
1.4568 1.2215 2.9196 2.3933 4.5543 980965.6977 817158.5127 16.0489

Strategy performs well, with strong risk-adjusted metrics (Sharpe and Calmar Ratios) and substantial profitability. The graph clearly demonstrates a consistent upward trajectory for both gross and net PnL, with close alignment indicating efficient trade execution and manageable costs. While there are some drawdowns (notably mid-May), the recovery is swift, reflecting the profit.

Group 2 - 2023 first quarter results

grossSR netSR grossCR netCR av_daily_ntrades grossPnL netPnL stat
-0.0603 -0.2962 -0.1019 -0.4712 5.2197 -487751.5231 -238117.2248 -2.5788

The strategy performed poorly during Q1 2023, as indicated by negative metrics across Sharpe Ratio, Calmar Ratio, and PnL. The graph sustains losses, significant drawdowns, and only minimal recoveries. The increased number of trades (higher daily activity) contribute to inefficiency, increasing costs and eroding profitability as a result.

Group 2 - 2023 third quarter

grossSR netSR grossCR netCR av_daily_ntrades grossPnL netPnL stat
0.5604 0.2986 0.7815 0.4037 4.9670 372440.7214 197466.0342 2.1034

The graph shows strong upward trends in July and late September, with significant drawdowns in late August and early September. The Sharpe Ratio (gross: 0.5604, net: 0.2986) reflects modest risk-adjusted returns, with some impact from costs. Similarly, the Calmar Ratio (gross: 0.7815, net: 0.4037) indicates moderate recovery, though costs slightly hinder overall performance.

Group 2 - 2024 third quarter

grossSR netSR grossCR netCR av_daily_ntrades grossPnL netPnL stat
-1.1797 -1.3948 -1.5367 -2.4594 4.5483 -1325203.9319 -1407277.3191 -11.9321

The graph shows a downward trend overall, with minor recoveries in mid-July and late August, followed by steep declines in early September and late September. The Sharpe Ratio (gross: -1.1797, net: -1.3948) indicates negative risk-adjusted returns, suggesting the strategy consistently underperformed relative to its volatility. The Calmar Ratio (gross: -1.5367, net: -2.4594) further reflects significant drawdowns and poor recovery ability.

Group 2 - 2024 fourth quarter

grossSR netSR grossCR netCR av_daily_ntrades grossPnL netPnL stat
0.3820 0.2320 0.7983 0.4646 4.2903 383461.0424 232221.0142 2.5308

The graph for Q4 2024 shows a significant improvement in performance compared to the previous quarter, with steady growth overall and recovery from drawdowns. Peaks are evident in late November and late December, while drawdowns occur around mid-October and early December. The Sharpe Ratio (gross: 0.3820, net: 0.2320) reflects modest but positive risk-adjusted returns, indicating improved profitability relative to volatility. The Calmar Ratio (gross: 0.7983, net: 0.4646) highlights better drawdown recovery and resilience.

Group 2 - Summary

quarter grossSR netSR grossCR netCR av_daily_ntrades grossPnL netPnL stat
2022_Q2 1.4568 1.2215 2.9196 2.3933 4.5543 980965.6977 817158.5127 16.0489
2023_Q1 -0.0603 -0.2962 -0.1019 -0.4712 5.2197 -487751.5231 -238117.2248 -2.5788
2023_Q3 0.5604 0.2986 0.7815 0.4037 4.9670 372440.7214 197466.0342 2.1034
2024_Q3 -1.1797 -1.3948 -1.5367 -2.4594 4.5483 -1325203.9319 -1407277.3191 -11.9321
2024_Q4 0.3820 0.2320 0.7983 0.4646 4.2903 383461.0424 232221.0142 2.5308

The strategy shows strong potential in favorable quarters, such as the second quarters of 2022 and 2023, 2024 with high risk-adjusted returns and effective recovery from drawdowns, indicating consistent profitability and efficient cost management. However, it suffers from significant underperformance in challenging periods, like the third quarter of 2024, where large drawdowns and poor recovery heavily impacted profitability. Morever, sign of gross and net PnL and number of transaction in all quarters shows that all loss is contributed by stategy performance not high transaction cost.

The fluctuations reveal a high sensitivity to market conditions, suggesting that the strategy may depend on specific dynamics for success.