Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
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.
|
|
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)?
|
|
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 BasicsAttachments: Correlation with Symbol.sfInd - 5 KB, downloaded 796 time(s).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 6/30/2009 Posts: 57
|
This was very useful - thaks Bruce!
Doug
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |