Cointegration & Spread Analyzer

Piggy backing off of the following two ideas to implement mean reversion and hedging across multiple markets:

https://roadmap.strategyquant.com/tasks/sq4_2829

https://roadmap.strategyquant.com/tasks/sq4_0041

Eventually there will need to be a section dedicated to algorithms that trade multiple markets simultaneously. This will either produce classic algorithms we are used to, as explained in the hedge/basket request, where algos are generated via using indicator blocks. Mean reverting strategies would not rely on this approach because it relies on cointegrated instruments in order to determine entries and exits. 

Rather than individually testing one instrument data set against another to test for cointegration, it would be smart if we had something like portfolio master where we could load up all of our different time series data sets and have it analyze automatically which time series are cointegrated. This would be helpful in the future when developing these sort of strategies for many instruments at once: i.e. stock traders that want to test 100 different stocks at once to find multiple cointegrated relationships. Finding multiple cointegrated markets (3 or more) will also require SQ to test using appropriate risk management for each market relative to the risk management of the system. This needs to be accounted for in tests.

Additionally, there needs to be a way to trade the spread between markets as well. Cointegration is great for mean reversion. It may also prove to be well suited for mean expansion (where you trade from the mean to the outer deviation). However markets do not need to be cointegrated in order to trade this sort of expansion and trade profitably. There should be an analyzer that takes multiple markets and analyzes different combinations of the spreads between them in order to determine if there are spread trading opportunities. Instead of looking at mean reversion, SQ would look for divergence in the spread between two (or more) assets and measure the frequency of which this happens and the average/max the spread diverges etc. Strategies based on the spread of multiple assets should be able to use standard indicator blocks on the spread price between multiple assets in order to find entries. This will also require making sure the money management is handled proportionally between markets in tests.

When the hedging/basket section is made, this will be a huge addition as there aren't many tools that handle the difficult parts of finding statistical arbitrage opportunities.


Also, you should be able to create a synthetic chart of the spread between two or more assets and then use indicator blocks on that chart in order to generate strategies that way as well. Buy or sell signals on this chart would be converted into the appropriate combination of buy/sell signals on the underlying assets when the final strategy is produced.

Attachments
No attachments
  • Votes +7
  • Project StrategyQuant X
  • Type Feature
  • Status Archived
  • Priority Normal
  • Assignee None

History

KL
#1

kainc301

13.09.2019 16:34

Task created

Rr
#2

Partizanas

13.09.2019 17:28
Voted for this task.
KP
#3

CooleRnax

13.09.2019 17:36
Voted for this task.
KL
#4

kainc301

13.09.2019 17:43
Voted for this task.
Dw
#5

Diwi

15.09.2019 21:22
Voted for this task.
KD
#6

kejdi

03.11.2019 15:50
Voted for this task.
VO
#7

GRoundofInferno

17.12.2019 23:31
Dear development team and fellow users,

I have found statistical arbitrage as a additional style of trading and I think that this idea is worth to discuss and if approved to be implemented. 
As I understand stat arb, with some sort of diversification, gives us an opportunity to stay market neutral. 
So it will be helpful if you can:
1.Analyze spreads of different pairs and find most correlated
2. Track automatically such pairs for signals
3. Automatically open trade when spread hits +-2 standard deviation (or something like this)
4.Close when spread reaches 0 or other variables. 


One of the advantages is that you can check the efficiency of such trading in SQX, as mt4 will not allow you to backtest such strategies. 
 
This idea can be extended if community decides that it is worth it. 
Thank you 

P.S Thank you keinc301 for some research and suggestions. 

My previous ticket 


https://roadmap.strategyquant.com/tasks/sq4_5795


VO
#8

GRoundofInferno

17.12.2019 23:31
Voted for this task.
k
#9

Karish

16.08.2020 21:09
Voted for this task.
MF
#10

Mark Fric

26.10.2020 11:28

Status changed from New to Archived


Votes: +7

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please