Request: Mean reversion functionality - Pair trading

Mark - can you build in functionality to find mean reversion strategies?
No attachments
  • Votes +4
  • Project StrategyQuant X
  • Type Feature
  • Status Archived
  • Priority Normal
  • Assignee None
  • Milestone Archived (To be done later)




09.06.2017 15:44

Task created


Mark Fric

16.06.2017 17:23
yes, but how exactly do you think it should work?  


18.06.2017 03:59

I am really not of the mathematical sophistication to steer this but I know that this article is the right place to start:


Mark Fric

27.08.2018 09:17

Milestone changed from None to To be done later



04.09.2018 19:56
I believe this is for the purpose of finding statistical arbitrages that revert back to the mean by using methods like cointegration in order to see where those anomalies exist. You can add the data of different markets and time series to see if multiple datasets form a tradeable cointegrated pair as far as I understand. Here are a few threads of people discussing how they use it. You might even be able to add capabilities of R.



17.09.2018 20:06
Voted for this task.


10.01.2019 20:50
Not sure what exactly you are looking for, as SQX already finds mean reversion strategies on it´s own by using indicators. It´s not something you should specifically force, as some symbols mean reverse (AUDCAD most of the time for example), and others breakout instead (EURUSD). That´s the beauty of SQX that it will find the right approach for every market / symbol on it´s own and that already works fine.


27.01.2019 18:54
Voted for this task.


27.01.2019 18:56
I believe the type of mean reversion being referred to here is based on the relationship between multiple instruments. This is more in the realm of statistical arbitrage. I don't believe that's anything an indicator based strategy can catch. It would be interesting to see if the two can be mixed together. 


03.09.2019 17:41
After looking into this deeply, this would require cointegration tests between multiple assets for pairs trading.

The implementation of this should not use indicator blocks at all. Instead, strategies should trade based on when the spread price of multiple combined assets moves a certain deviation away from the mean. 

SQ would need entirely new calculations in order to determine:

  • Cointegration/Stationarity tests
  • The risk that is apportioned to each instrument. 
  • The stop loss based on deviation from the mean
  • Take profit based on proximity to the mean
  • Trailing stop based on proximity to mean
  • Total margin/trade
  • Logic for multiple cointegrated assets

This is purely statistical arbitrage and would definitely be great to have, especially for those using SQX for stocks, however there are cointegrated FX pairs as well. 

For an overview of what cointegration pairs trading is:


Mark Fric

27.01.2020 09:04

Subject changed from Request: Mean reversion functionality to Request: Mean reversion functionality - Pair trading


Mark Fric

16.02.2020 13:52

Status changed from New to Archived



17.08.2020 09:12
Voted for this task.


23.09.2021 23:56
Voted for this task.

Votes: +4

Drop files to upload


choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

Wait please