Pairs Trading with Metastock?

Castor

Junior member
Messages
13
Likes
0
Does anyone know of way to use Metastock for pairs trading? It appears to be impossible to use a signal generated by the relationship between two securities as an order/alert for either one of them. Or am I missing something?
 
Pairs trading relies on tight correlation and mean deviation. Also consider Beta correlation and remember to ratio your actual trade volumes accurately. I have created a model for pairs trading in Excel which works well, however I need to set up an automatic correlation search facility to find stocks/funds with a tight correlation. One option is a basket of gold stocks and an ETF gold fund, or gold spot price. Should be possible to arbitrage trade on a greater scale using commodities and ETF's but again this is something I have not had time to look into. Possibly tradestation can be programmed to search for correlations - does anyone know?
 
Read the Manual!

You can also read the Downloader Manual, where a section covers what you wnat to do.
It is called "New Composite" and it is found on page 42 - at least in my copy.
Hope this helps.

Eduardo:smart:
 
Trading two stocks in the same sector which are loosely correlated is not pairs trading. Its a completely pointless exercise. You are taking two opposing directional trades within the same sector for no reason other than the graphs look similar when overlaid and you fancy the idea of hedging your bets. Commission/spread is most likely to destroy any potential profit even with a tight stop on both trades. You may as well just trade one of the stocks short/long with a tight stop.
Do you have a formula for your correllation? How are you comparing movements? How are you calculating the deviations? What timescale are you backtesting your model over?
I could go on - let the amateurs 'pairs trade' and concentrate on creating a strategic model based on technical parameters and do not think it needs to be complex to be very effective - alternatively you will need to devote a lot of time and effort creating your own pairs trading model from scratch, and the calculations involved are horrendous.
Good Luck
 
You can also read the Downloader Manual, where a section covers what you wnat to do.
It is called "New Composite" and it is found on page 42 - at least in my copy.
Hope this helps.

Eduardo:smart:

Thanks, Zeppo. I have read the manual and I know about composites, but the only way I can see that you could set up a pair trading on Metastock would be if you were trading a pretty simple system based on the ratio alone. Even then, you couldn't use a signal generated by the composite as a signal for one of the two securities that go to make it up. Or am I wrong?
 
Pairs trading relies on tight correlation and mean deviation. Also consider Beta correlation and remember to ratio your actual trade volumes accurately. I have created a model for pairs trading in Excel which works well, however I need to set up an automatic correlation search facility to find stocks/funds with a tight correlation. One option is a basket of gold stocks and an ETF gold fund, or gold spot price. Should be possible to arbitrage trade on a greater scale using commodities and ETF's but again this is something I have not had time to look into. Possibly tradestation can be programmed to search for correlations - does anyone know?

I don't know about Trade Station, but I do know that you can take a lot of the slog out of selecting pairs by using PairTrade Finder. You can download it from the site of the same name and try it out for 30 days. The software also gives trading signals, but you can take 'em or leave 'em. Only snag is that you may not be able to use it to correlate a commodity with a security. But if you're happy to use an ETC as a substitute for the underlying cash price it should work.

I agree with you about tight correlations, though I have also found -- maybe you have too -- that there is such a thing as too tight. Trading Royal Dutch Shell A and B, for example, I've found that, if you get a significant deviation from the ratio at the close it will often have been closed up by the market makers when they offer prices for the following day's open -- and the stretch you are left with is not enough to offer a profit that makes the trade worth the trouble.

One final point. You say "consider Beta correlation" -- in what way?
 
Thanks, Zeppo. I have read the manual and I know about composites, but the only way I can see that you could set up a pair trading on Metastock would be if you were trading a pretty simple system based on the ratio alone. Even then, you couldn't use a signal generated by the composite as a signal for one of the two securities that go to make it up. Or am I wrong?

I don't know - I don't pair trade, it's hard enough to get it right with one product; but I thought that was the objective of composite charts.
You could address the issue with Equis; who knows, you might even be lucky and they would do something about it.

Eduardo :)
 
Many many sums and graphs needed

Beta Correlation refers to Beta.
FTSE = 1 If a stock moves 2% for every 1% the FTSE moves then it has a Beta of 2.

You need to compensate for respective Beta in each stock when considering the number of shares to trade for each stock. You need to formulate the calculation for the two stocks beta as a ratio, therfore, you buy 1.6 shares of x for every 1 of y, in order to balance the trade correctly.
The whole setup is insanely complicated if you want to do it properly, I really would leave it alone. I had some seriously good Prop traders struggling to understand the calculations involved on my excel sheet. I will have a look at the Pair trade finder tho, thanks.
And actually, the correct opportunity only comes round about every 8 - 12 weeks, therefore you need a huge number of correlated opportunities to trade the system even once a week, and frankly I doubt they exist. This is why i have not taken it further, that and a lack of time. And no they cant be too closely correllated and really you need at least a million pounds to take advantage of the deviations which are very small. So you could use £100k and leverage it if you liked.
Basically, its a lot of effort and time to do it properly and most people who confidently tell you they 'Pairs trade' are a bunch of jokers. Generally they are the most dangerous type of trader out there - they think they know what they're doing! :clap:
 
Thanks for all for sharing information. Does anyone is aware of any software which can do following task:

• Can find correlation between two securities (taking care of latest price data)
• Can find the difference between the normalized price of two related securities
• Can find mean, standard deviation and other statistical parameter
• Can tell what is the deviation on the live basis
• Can give me beta of each security (taking care of latest price movement)

Currently, I’m using excel to perform all this task, but it very time consuming to find any trading opportunity based on arbitrage strategy.

I will appreciate if people can share if there is any software available for this.

Regards
 
Going back to the Initial Question from Castor about Metastock.

I may be missing the point here but i have just spent 2 minutes with the Metastock Formula Primer manual and found this formula:

Security("Symbol", Data Array)

Basically you can create any formula you like and when the result depends on a value from another security, you can use the formula above. More details in the Primer on P68.

This can be incorporated into any Expert or System Test you want to perform.

Hope that helps

G
 
Last edited:
Going back to the Initial Question from Castor about Metastock.

I may be missing the point here but i have just spent 2 minutes with the Metastock Formula Primer manual and found this formula:

Security("Symbol", Data Array)

Basically you can create any formula you like and when the result depends on a value from another security, you can use the formula above. More details in the Primer on P68.

This can be incorporated into any Expert or System Test you want to perform.

Hope that helps

G

Did go to Primer, read the details and tried to implement it.... seems am making some error somewhere!!! It did not work.
Thaks anyway for pointing out the proper place to look for it!!
 
Did go to Primer, read the details and tried to implement it.... seems am making some error somewhere!!! It did not work.
Thaks anyway for pointing out the proper place to look for it!!

Keep trying, don't give up.
Programming isn't easy; there is also a forum for MS users, and this one is useful too:
http://tradersconsortium.com/community/index.php
I strongly suggest that you visit them with your query, there is a habit of helping others MS users in those forums.

Eduardo.:)
 
Keep trying, don't give up.
Programming isn't easy; there is also a forum for MS users, and this one is useful too:
http://tradersconsortium.com/community/index.php
I strongly suggest that you visit them with your query, there is a habit of helping others MS users in those forums.

Eduardo.:)

Thanks Zeppo, your encouraging words did help!! I think I am 80% through with what I wanted. I will surely visit the community u have linked. Thanks buddy, have a great day.
-R K Karnani
 
Thanks Zeppo, your encouraging words did help!! I think I am 80% through with what I wanted. I will surely visit the community u have linked. Thanks buddy, have a great day.
-R K Karnani

You too, mate; glad to be of help.:D

Eduardo.:)
 
Thanks for all for sharing information. Does anyone is aware of any software which can do following task:

• Can find correlation between two securities (taking care of latest price data)
• Can find the difference between the normalized price of two related securities
• Can find mean, standard deviation and other statistical parameter
• Can tell what is the deviation on the live basis
• Can give me beta of each security (taking care of latest price movement)

Currently, I’m using excel to perform all this task, but it very time consuming to find any trading opportunity based on arbitrage strategy.

I will appreciate if people can share if there is any software available for this.

Regards

Tradelink (http://www.code.google.com/p/tradelink/ ) is a pretty powerful and open source library which does a lot of things.
Here is an application example which uses tradelink to do similar tasks:
http://www.quantcode.com/modules/mydownloads/singlefile.php?cid=15&lid=579
 
Top