StockFetcher Forums · General Discussion · Historical Data by Sector?<< 1 2 >>Post Follow-up
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?

StockFetcher Forums · General Discussion · Historical Data by Sector?<< 1 2 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.