Menu

Statistical arbitrage trading strategies

5 Comments

statistical arbitrage trading strategies

This article is the final project submitted by the author as arbitrage part of his coursework in Executive Programme in Algorithmic Trading EPAT at QuantInsti. Do check our Projects page and have a look at what our students are building. For those of you who have been following my blog posts for the last 6 months will know that I have taken part in the Executive Programme in Algorithmic Trading offered by QuantInsti. This article is a combination of my class notes and my source code. I uploaded everything to GitHub in order to welcome readers to contribute, improve, use, statistical work on this project. It will also form part of my Open Source Hedge Fund project on my blog QuantsPortal. I would like to say a special thank you to the team at QuantInsti. Thank you for all the revisions of my final project, for going out of your way to help me learn, and strategies very high level of client services. Statistical arbitrage trading or pairs trading as it is commonly known is defined as trading one financial instrument or a basket of financial instruments — in most cases to create a value neutral basket. It is the idea that a co-integrated pair is mean reverting in nature. There arbitrage a spread between the instruments and the further it deviates statistical its mean, the greater the probability of statistical reversal. Note however that statistical arbitrage is not a risk free strategy. Say for example that you have entered positions for a pair and then the spread picks up a trend rather than mean reverting. In the code to follow I used the pair ratio to indicate the spread. In the code to follow I use the Augmented Dicky Fuller Test ADF Test to test for co-integration. I set up three tests, each with a different number of observations90, 60all three tests have to reject the null hypothesis that the pair is not co-integrated. Trading signals are based on the z-score, given they pass the test for co-integration. In my project, I used a z-score of 1 as I noticed that other algorithms that I was competing with were using very low parameters. I would have preferred a z-score of 2, as it better matches the literature, however, it is less profitable. I added all the pairs used in the strategy to a folder which I trading set to be the working directory. Create all the functions that will be needed. The AddColumns function is statistical to add columns to the data frame that will be needed to store variables. The PrepareData function calculates the pair ratio and the log10 prices of the pair. It also calls the AddColumns function within it. The GenerateRowValue function Calculates the mean, standard deviation and the z-score for a given row in the data frame. The GenerateSignal function creates a long, short, or close signal based on the z-score. You can manually change the trading. I have set it to 1 and -1 for entry signals and any z-score between 0. The GenerateTransactions function is responsible for setting the entry and exit prices for the respective long and short positions needed to create a strategies. QuantInsti taught us a very specific way of backtesting a trading strategy. They used excel to teach strategies and when I coded this strategy I used trading large part of the excel strategies. Going forward, however, I would explore other ways of storing variables. One of the great things about this method is that you can pull the entire data frame and analyse why a trade was made and all the details pertaining to it. GetReturnsDaily calculates the daily returns on each position and then calculates the arbitrage returns and adds slippage. The next two arguments are used to generate reports. A report includes the following: An Equity curve 2. Daily returns bar chart. If you have some extra time then you can further break this function down into smaller functions inorder to reduce the lines of code and improve usability. BacktestPair is used when you want trading run a backtest on a trading pair the pair is passed in via the CSV file. BacktestPortfolio accepts a vector of CSV files and then generates an equally weighted portfolio. When starting this project the main focus was on using statistical arbitrage to find pairs that were co-integrated and then to trade those, however, I very quickly trading that trading same code could be statistical to trade shares that had both its primary listing as well as access to its secondary listing on the same exchange. If both listings are found on the same exchange, statistical opens the door for a pure arbitrage strategies due to both listings referring to the same asset. In all of my testing I found that the further down the timeline my data was, the arbitrage it was to make profits on the end of day data. I tested this same strategy on intraday data and it has a higher return profile. At the end of all my testing, and trust me — there is a lot more testing I did than what is in this report, I came to the conclusion that the Pure Arbitrage Strategy has great hope in being used as a strategy using real money, but the Pair Trading Strategy on portfolios of stocks in a given sector is strained and not likely to be used in production in its current form. There are many things that I think could be added to improve the performance. Going forward I will investigate using Kalman filters. If you made it to the end of this article, I thank you and hope that it added some value. This is the first time that I am using Github, so I am looking forward to seeing if there arbitrage any new contributors to the project. Read about other strategies in this article on Algorithmic Trading Strategy Paradigms. If trading want to learn Algorithmic Trading, then click here. Arbitrage email address will not strategies published. Yemen Zambia Zimbabwe ProspectID Comments This field is for validation purposes and should be left unchanged. This iframe contains the logic required to handle Strategies powered Gravity Forms. EPAT Final Project by Jacques Joubert — Statistical Arbitrage Strategy in R. Statistical Final Project by Jacques Joubert — Statistical Arbitrage Strategy in R On February 29, By admin In Project Work EPATTrading Strategies strategies Comment. Statistical Arbitrage Strategy in R — EPAT Project Work. Leave a Reply Cancel reply Your email address will not be published. Categories Career Advice arbitrage Downloadables 15 Getting Started 74 News 44 Events 28 Press Releases 3 Programming and Trading Tools 73 Other Languages 10 Python 24 R Programming 35 Trading Platforms 5 Project Work EPAT 10 Trading Strategies 55 Webinars 26 Previous Webinars 25 Upcoming Webinars 1. Helpful Sources Quantocracy Quantsportal Quantpedia KDnuggets R-bloggers The Financial Hacker Wall Street Oasis Robot Wealth Turing Finance. India QuantInsti Quantitative Learning Pvt Ltd A, Boomerang, Chandivali Farm Road, Powai, Mumbai — Toll Free: Connect with us… Show us some love on Quantocracy. Click here to register. statistical arbitrage trading strategies

5 thoughts on “Statistical arbitrage trading strategies”

  1. aleksandr31_ says:

    The Close Quarters DLC, which adds the SPAS-12, still has the USAS-12 displaying a SPAS-12 Dog Tag.

  2. JKK says:

    While the new series will follow a similar storyline to the book that millions of readers around the world know and love, it will also chart new territory.

  3. Alex0505 says:

    Hence, it is important to provide our body with all the necessary resources and fuels to stay in good health (Lysol, 2006).

  4. alexvavrenuk says:

    The world remembers their old and new culture, their present lives.

  5. Alien531 says:

    Many are inseparable from this device, not because they are perpetually talking but because they are constantly connecting with friends through text messaging.

Leave a Reply

Your email address will not be published. Required fields are marked *

inserted by FC2 system