Request: Mean reversion functionality - Pair trading

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

History

?
#1

anonymous

09.06.2017 15:44

Task created

MF
#2

Mark Fric

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

anonymous

18.06.2017 03:59
Mark,


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

https://www.quantstart.com/articles/Basics-of-Statistical-Mean-Reversion-Testing



MF
#4

Mark Fric

27.08.2018 09:17

Milestone changed from None to To be done later

KL
#5

kainc301

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. 


https://www.quantst.com/archives/146

https://www.forexfactory.com/showthread.php?t=363198

https://www.forexfactory.com/showthread.php?t=262827

https://www.forexfactory.com/showthread.php?t=260422

https://www.r-project.org/




m
#6

mikeyc

17.09.2018 20:06
Voted for this task.
g
#7

geektrader

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.
KL
#8

kainc301

27.01.2019 18:54
Voted for this task.
KL
#9

kainc301

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. 
KL
#10

kainc301

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:

https://www.youtube.com/watch?v=g-qvFjvyqcs

https://www.youtube.com/watch?v=JTucMRYMOyY

https://www.youtube.com/watch?v=Pn_RiDbK82M

MF
#11

Mark Fric

27.01.2020 09:04

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

MF
#12

Mark Fric

16.02.2020 13:52

Status changed from New to Archived

SF
#13

SergeyF

17.08.2020 09:12
Voted for this task.
M
#14

MM1

23.09.2021 23:56
Voted for this task.

Votes: +4

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please