pairs trading matlab - Matlab, R project and Python | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > Matlab, R project and Python

pairs trading matlab
Started:October 6th, 2014 (09:55 PM) by alecase Views / Replies:616 / 1
Last Reply:October 6th, 2014 (09:55 PM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

pairs trading matlab

Old October 6th, 2014, 09:55 PM   #1 (permalink)
Trading Apprentice
ottawa canada
Futures Experience: Beginner
Favorite Futures: es
Posts: 4 since Oct 2014
Thanks: 0 given, 0 received

pairs trading matlab

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

Thank you very much for your cooperation
ps do you know where I can find some code on the pairs trading?

Last edited by alecase; October 7th, 2014 at 10:27 AM.
Reply With Quote

Old October 6th, 2014, 09:55 PM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > Matlab, R project and Python > pairs trading matlab

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Algorithmic pairs trading sysot1t Elite Automated Trading 64 April 8th, 2015 06:52 PM
Pairs trading issue bogdan ThinkOrSwim Programming 1 July 25th, 2014 10:00 AM
Anyone Do Stock Pairs Trading? MedianVelocity Stocks and ETFs Trading 3 February 28th, 2014 05:18 AM
Spread / Pairs trading indicators Mehul Stocks and ETFs Trading 3 November 13th, 2011 03:54 PM

All times are GMT -4. The time now is 03:50 PM.

Copyright © 2016 by All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts

Page generated 2016-10-22 in 0.07 seconds with 19 queries on phoenix via your IP