Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Market Corelation Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
nimmer.jacob
Posted : Saturday, February 27, 2010 4:17:57 PM
Registered User
Joined: 11/13/2009
Posts: 12
Is ther any way to backtest pairs trading or the corellation between the movement of the S&P 500 vs a given stock?  I see that my last question isn't legiible for some reason, but I'll start with a simpler question at first.  Can I scan for stock that outperformed to S&P 500 on a daily basis.  If so, how?  Thanks.
nimmer.jacob
Posted : Saturday, February 27, 2010 4:27:09 PM
Registered User
Joined: 11/13/2009
Posts: 12
Second question: can I create a code that scans for stock that gapped by a smaller % than the S&P500 (I like using the SPY ETF)?
Bruce_L
Posted : Wednesday, March 3, 2010 10:25:30 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
QUOTE (nimmer.jacob)
Is ther any way to backtest pairs trading or the corellation between the movement of the S&P 500 vs a given stock?

You might want to try using correlation in StockFinder. This should range from 1 to -1. Something that has an exact linear relationship to the comparison symbol should have a correlation of 1. Something that has an opposite linear relationship (slopes the opposite direction) should have a correlation of -1. Something that does not have a linear relationship should have a correlation of 0 (with a variety of degrees in between).

You should be able to Open an attached Indicator directly into a running copy of StockFinder (and save it from within StockFinder if desired).

QUOTE (nimmer.jacob)
Can I scan for stock that outperformed to S&P 500 on a daily basis.

If you add a Price for Symbol Indicator to the Chart and change the Symbol to SPY, you could Drag and Drop it into the Code tab of the RealCode Editor to create something similar to the first line of the following RealCode Rule:

'# PfS = indicator.PriceforSymbol
'# Period = UserInput.Integer = 1
If Price.PercentChange(Period) > PfS.PercentChange(Period) Then Pass

QUOTE (nimmer.jacob)
Second question: can I create a code that scans for stock that gapped by a smaller % than the S&P500 (I like using the SPY ETF)?

How are you defining a Gap?

Is your Gap Up measured from the previous Close to the current Open? From the previous High to the current Open? From the previous High to the current Low? Something else entirely?

Is your Gap Down measured from the previous Close to the current Open? From the previous Low to the current Open? From the previous Low to the current High? Something else entirely?

Are we comparing Gap Ups to Gap Downs or are we only comparing Gap Ups to Gap Ups and Gap Down to Gap Downs? Are you interested in comparing the actual percentages or the magnitude of the percentages?

Rule Basics
BackScanner Basics

Attachments:
Correlation with Symbol.sfInd - 5 KB, downloaded 796 time(s).



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
tuckandturn
Posted : Tuesday, May 31, 2011 1:19:03 PM
Registered User
Joined: 6/30/2009
Posts: 57
This was very useful - thaks Bruce!

Doug
Bruce_L
Posted : Tuesday, May 31, 2011 1:25:40 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You're welcome.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.