novacane32000 331 posts msg #123290 - Ignore novacane32000 |
3/21/2015 12:03:46 PM
Kevin
Did you find that using just XLI,XLU and AGG worked best? as opposed to considering a larger basket with more sectors represented such as for example
Symlist (XLI,XLU,AGG,IBB,IYT,IYZ,XLE,XLP,XLF,XRT,XLV)
|
fotchstecker 304 posts msg #123312 - Ignore fotchstecker |
3/23/2015 3:54:58 PM
Kevin, is there any chance that you would consider sharing the SS code?
|
Kevin_in_GA 4,599 posts msg #123317 - Ignore Kevin_in_GA |
3/23/2015 8:29:53 PM
Sure.
First, you will need to create a custom script - this is basically a user-defined set of calculations which can include comparisons and "if" statements. Create a new Custom Formula and name it "WeeklyRank". The code is as follows:
parm1 = parameter("parm1");
r = 0;
r = r + if(period(weekly, proc(close,parm1)) > symbol(XLU, period(weekly, proc(close,parm1))),1,0);
r = r + if(period(weekly, proc(close,parm1)) > symbol(XLI, period(weekly, proc(close,parm1))),1,0);
WeeklyRank = 2 - r;
Now create a new Strategy as follows:
Entry String:
WeeklyRank(@1weeks) = 1 and
period(weekly,proc(close,@1weeks)) > 0
Exit String:
WeeklyRank(@1weeks) > 1
Variables:
@1weeks 1 to 52 by 1
The exit is always at the market open the next day (beginning of the following week).
This will run all 52 time periods and show you how each look back period performed during the period of the backtest.
Finally you need to create a new sector - call it "XLI and XLU" and put into it only XLI and XLU. That is the sector against which this filter is run to get the correct results.
Enjoy.
|
fotchstecker 304 posts msg #123318 - Ignore fotchstecker |
3/23/2015 9:16:03 PM
Kevin, I've been learning SS the best I can in spare time. Pointing me to how custom scripts are used has cut a huge swath out of the learning curve. Many thanks, and many thanks for laying out the process. I have just gotten the basics down: setting up sectors (aside from the imports), building the entries and exits, configuring the test parameters, etc. It would have taken me a long time to figure out that I needed custom scripting.
This helps a lot. Again, many thanks.
Out of curiosity, how long did it take you to get a firm handle on SS?
|
djones000buck 206 posts msg #123338 - Ignore djones000buck |
3/25/2015 5:36:19 PM
Speaking of the dow sector indices, is it just me or is it annoying that current day chart values display as zero, really messes with chart scale. I'm assuming the indices update EOD. Would be nice if current day was just excluded until update occurs..
|
jackmack 334 posts msg #124264 - Ignore jackmack |
7/6/2015 8:49:57 PM
If nothing shows up Friday (like Friday June 19 2015 no XLU - XLI - AGG) do you just go to cash like in a previous version?
|