Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.
Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.
Search the Community
Showing results for tags 'pairs'.
Found 2 results
Good morning everyone I saw a pairs trading webinar on the topic and found this code. I can not understand these two pieces of code, anyone is kind enough to explain % The strategy: % 1 Compute residuals over next N days res = series2 (i: i + N-1, 1) ... - (Reg1.coeff (1) + reg1.coeff (2). * Series2 (i: i + N-1, 2)); % 2 If the residuals are large and positive, then the first series % Is Likely to decline vs. the second series. Short the first % Series by a scaled number of shares and long the second series by 1% share. If the residuals are large and negative, do the % Opposite. indicated (i: i + N-1) = res / reg1.RMSE; s (i: i + N-1, 2) = (res / reg1.RMSE> spread) ... - (Res / reg1.RMSE <-spread); s (i: i + N-1, 1) = -reg1.coeff (2). * s (i: i + N-1, 2); end end Thank you very much for your cooperation ps do you know where I can find some code on the pairs trading?
I trade futures pairs using a mean reversion strategy called Statistical Arbitrage (StatArb). And the processes is highly dependent upon divergences from an equilibrium that is usually caused by some market event or interruption. This energy has the effect of reverberating through through price correlations and causing a divergence, which I wait until that divergence has statistical significance and then bet on its reversion to the equilibrium. During times of low volatility, like now, with the VIX below or near 20, these divergences, let's call them bumps, are much smaller than when in higher volatile markets. The other problem is runaway markets, like the Nasdaq, which complicates matters even more, by skewing these bumps and reducing opportunity. How do you adjust your strategy to accommodate these aberrations?