StockFetcher Forums · Filter Exchange · Here is my 1st shot at a seasonality Filter<< >>Post Follow-up
SAFeTRADE
644 posts
msg #146492
Ignore SAFeTRADE
modified
2/9/2019 10:32:12 PM

It can only go back 2 years or so. See any errors in code or strategy speak up. I sent this to
Stockfetcher folks for them to look at also. At 1st glance I don't see any obvious edge here.

Fetcher[/* Reference a specific date */
set{var1,DATE(20170101,close)}
set{var2,date(20170131,close)}
set{var3, var2 / var1}

set{var4,DATE(20170201,close)}
set{var5,date(20170228,close)}
set{var6, var5 / var4}

set{var7,DATE(20170301,close)}
set{var8,date(20170331,close)}
set{var9, var8 / var7}

set{var10,DATE(20170401,close)}
set{var11,date(20170430,close)}
set{var12, var11 / var10}

set{var13,DATE(20170401,close)}
set{var14,date(20170430,close)}
set{var15, var14 / var13}

set{var16,DATE(20170501,close)}
set{var17,date(20170531,close)}
set{var18, var17 / var16}

set{var19,DATE(20170601,close)}
set{var20,date(20170530,close)}
set{var21, var20 / var19}

set{var22,DATE(20170801,close)}
set{var23,date(20170830,close)}
set{var24, var23 / var22}

set{var25,DATE(20170901,close)}
set{var26,date(20170930,close)}
set{var27, var26 / var25}

set{var28,DATE(20171001,close)}
set{var29,date(20171031,close)}
set{var30, var29 / var28}

set{var31,DATE(20171101,close)}
set{var32,date(20171130,close)}
set{var33, var32 / var31}

set{var34,DATE(20171201,close)}
set{var35,date(20171231,close)}
set{var36, var35 / var34}

/* END 2017 */

set{var1a,DATE(20180101,close)}
set{var2a,date(20180131,close)}
set{var3a, var2a / var1a}

set{var4a,DATE(20180201,close)}
set{var5a,date(20180228,close)}
set{var6a, var5a / var4a}

set{var7a,DATE(20180301,close)}
set{var8a,date(20180331,close)}
set{var9a, var8a / var7a}

set{var10a,DATE(20180401,close)}
set{var11a,date(20180430,close)}
set{var12a, var11a / var10a}

set{var13a,DATE(20180401,close)}
set{var14a,date(20180430,close)}
set{var15a, var14a / var13a}

set{var16a,DATE(20180501,close)}
set{var17a,date(20180531,close)}
set{var18a, var17a / var16a}

set{var19a,DATE(20180601,close)}
set{var20a,date(20180530,close)}
set{var21a, var20a / var19a}

set{var22a,DATE(20180801,close)}
set{var23a,date(20180830,close)}
set{var24a, var23a / var22a}

set{var25a,DATE(20180901,close)}
set{var26a,date(20180930,close)}
set{var27a, var26a / var25a}

set{var28a,DATE(20181001,close)}
set{var29a,date(20181031,close)}
set{var30a, var29a / var28a}

set{var31a,DATE(20181101,close)}
set{var32a,date(20181130,close)}
set{var33a, var32a / var31a}

set{var34a,DATE(20181201,close)}
set{var35a,date(20181231,close)}
set{var36a, var35a / var34a}

set{var37a,DATE(20190101,close)}
set{var38a,date(20190131,close)}
set{var39a, var38a / var37a}

/* END 2018 */


dow 30



add column var3{jan_2017}
add column separator
add column var6{feb_2017}
add column var9{mar_2017}
add column var12{apr_2017}
add column var15{may_2017}
add column var18{jun_2017}
add column var21{jul_2017}
add column var24{aug_2017}
add column var27{sep_2017}
add column var30{oct_2017}
add column var33(nov_2017}
add column var36{dec_2017}


add column var3a{jan_2018}
add column separator
add column var6a{feb_2018}
add column var9a{mar_2018}
add column var12a{apr_2018}
add column var15a{may_2018}

/*add column var18a{jun_2018}
add column var21a{jul_2018}
add column var24a{aug_2018}
add column var27a{sep_2018}
add column var30a{oct_2018}
add column var33a(nov_2018}
add column var36a{dec_2018} */
add column separator
add column var39a{jan_2019}

chart-length 2 years
]



Cheese
1,374 posts
msg #146495
Ignore Cheese
2/9/2019 11:56:27 PM

Just a quick look' There was one typo. I could be wrong.
Also, why commented out the last part of 2018 when there was a correction.
I commented the first few months of 2017 instead just to see what happens.

Cheese
1,374 posts
msg #146496
Ignore Cheese
2/9/2019 11:58:15 PM

Fetcher[

CHART-TIME 24 MONTHS

/* Reference a specific date */
/*
set{var1,DATE(20170101,close)}
set{var2,date(20170131,close)}
set{var3, var2 / var1}

set{var4,DATE(20170201,close)}
set{var5,date(20170228,close)}
set{var6, var5 / var4}

set{var7,DATE(20170301,close)}
set{var8,date(20170331,close)}
set{var9, var8 / var7}

set{var10,DATE(20170401,close)}
set{var11,date(20170430,close)}
set{var12, var11 / var10}

set{var13,DATE(20170401,close)}
set{var14,date(20170430,close)}
set{var15, var14 / var13}

set{var16,DATE(20170501,close)}
set{var17,date(20170531,close)}
set{var18, var17 / var16}
*/

set{var19,DATE(20170601,close)}
set{var20,date(20170630,close)} /* 06 not 05 */
set{var21, var20 / var19}

set{var22,DATE(20170801,close)}
set{var23,date(20170830,close)}
set{var24, var23 / var22}

set{var25,DATE(20170901,close)}
set{var26,date(20170930,close)}
set{var27, var26 / var25}

set{var28,DATE(20171001,close)}
set{var29,date(20171031,close)}
set{var30, var29 / var28}

set{var31,DATE(20171101,close)}
set{var32,date(20171130,close)}
set{var33, var32 / var31}

set{var34,DATE(20171201,close)}
set{var35,date(20171231,close)}
set{var36, var35 / var34}

/* END 2017 */

set{var1a,DATE(20180101,close)}
set{var2a,date(20180131,close)}
set{var3a, var2a / var1a}

set{var4a,DATE(20180201,close)}
set{var5a,date(20180228,close)}
set{var6a, var5a / var4a}

set{var7a,DATE(20180301,close)}
set{var8a,date(20180331,close)}
set{var9a, var8a / var7a}

set{var10a,DATE(20180401,close)}
set{var11a,date(20180430,close)}
set{var12a, var11a / var10a}

set{var13a,DATE(20180401,close)}
set{var14a,date(20180430,close)}
set{var15a, var14a / var13a}

set{var16a,DATE(20180501,close)}
set{var17a,date(20180531,close)}
set{var18a, var17a / var16a}

set{var19a,DATE(20180601,close)}
set{var20a,date(20180530,close)}
set{var21a, var20a / var19a}

set{var22a,DATE(20180801,close)}
set{var23a,date(20180830,close)}
set{var24a, var23a / var22a}

set{var25a,DATE(20180901,close)}
set{var26a,date(20180930,close)}
set{var27a, var26a / var25a}

set{var28a,DATE(20181001,close)}
set{var29a,date(20181031,close)}
set{var30a, var29a / var28a}

set{var31a,DATE(20181101,close)}
set{var32a,date(20181130,close)}
set{var33a, var32a / var31a}

set{var34a,DATE(20181201,close)}
set{var35a,date(20181231,close)}
set{var36a, var35a / var34a}

set{var37a,DATE(20190101,close)}
set{var38a,date(20190131,close)}
set{var39a, var38a / var37a}

/* END 2018 */


dow 30



add column var3{jan_2017}
add column separator
add column var6{feb_2017}
add column var9{mar_2017}
add column var12{apr_2017}
add column var15{may_2017}
add column var18{jun_2017}
add column var21{jul_2017}
add column var24{aug_2017}
add column var27{sep_2017}
add column var30{oct_2017}
add column var33(nov_2017}
add column var36{dec_2017}


add column var3a{jan_2018}
add column separator
add column var6a{feb_2018}
add column var9a{mar_2018}
add column var12a{apr_2018}
add column var15a{may_2018}

add column var18a{jun_2018}
add column var21a{jul_2018}
add column var24a{aug_2018}
add column var27a{sep_2018}
add column var30a{oct_2018}
add column var33a(nov_2018}
add column var36a{dec_2018}
add column separator
add column var39a{jan_2019}

chart-length 2 years
]



Cheese
1,374 posts
msg #146497
Ignore Cheese
modified
2/10/2019 12:00:04 AM

Also, July 2017 and July 2018 are missing?

Last but not least, thanks for giving seasonality a try.

SAFeTRADE
644 posts
msg #146503
Ignore SAFeTRADE
2/10/2019 9:11:48 AM

Play with to yor hearts content. I don't think the whole 2 years will fit. Too many columns for Stockfetcher
to show. I am trying to show most current months. Such as Jan,Feb for 2017,2018,2019. That is my
intent not to hide any info. Could do it this way

Fetcher[/* Reference a specific date */
set{var1,DATE(20170101,close)}
set{var2,date(20170131,close)}
set{var3, var2 / var1}

set{var4,DATE(20170201,close)}
set{var5,date(20170228,close)}
set{var6, var5 / var4}

set{var7,DATE(20170301,close)}
set{var8,date(20170331,close)}
set{var9, var8 / var7}

set{var10,DATE(20170401,close)}
set{var11,date(20170430,close)}
set{var12, var11 / var10}

set{var13,DATE(20170401,close)}
set{var14,date(20170430,close)}
set{var15, var14 / var13}

set{var16,DATE(20170501,close)}
set{var17,date(20170531,close)}
set{var18, var17 / var16}

set{var19,DATE(20170601,close)}
set{var20,date(20170530,close)}
set{var21, var20 / var19}

set{var22,DATE(20170801,close)}
set{var23,date(20170830,close)}
set{var24, var23 / var22}

set{var25,DATE(20170901,close)}
set{var26,date(20170930,close)}
set{var27, var26 / var25}

set{var28,DATE(20171001,close)}
set{var29,date(20171031,close)}
set{var30, var29 / var28}

set{var31,DATE(20171101,close)}
set{var32,date(20171130,close)}
set{var33, var32 / var31}

set{var34,DATE(20171201,close)}
set{var35,date(20171231,close)}
set{var36, var35 / var34}

/* END 2017 */

set{var1a,DATE(20180101,close)}
set{var2a,date(20180131,close)}
set{var3a, var2a / var1a}

set{var4a,DATE(20180201,close)}
set{var5a,date(20180228,close)}
set{var6a, var5a / var4a}

set{var7a,DATE(20180301,close)}
set{var8a,date(20180331,close)}
set{var9a, var8a / var7a}

set{var10a,DATE(20180401,close)}
set{var11a,date(20180430,close)}
set{var12a, var11a / var10a}

set{var13a,DATE(20180401,close)}
set{var14a,date(20180430,close)}
set{var15a, var14a / var13a}

set{var16a,DATE(20180501,close)}
set{var17a,date(20180531,close)}
set{var18a, var17a / var16a}

set{var19a,DATE(20180601,close)}
set{var20a,date(20180530,close)}
set{var21a, var20a / var19a}

set{var22a,DATE(20180801,close)}
set{var23a,date(20180830,close)}
set{var24a, var23a / var22a}

set{var25a,DATE(20180901,close)}
set{var26a,date(20180930,close)}
set{var27a, var26a / var25a}

set{var28a,DATE(20181001,close)}
set{var29a,date(20181031,close)}
set{var30a, var29a / var28a}

set{var31a,DATE(20181101,close)}
set{var32a,date(20181130,close)}
set{var33a, var32a / var31a}

set{var34a,DATE(20181201,close)}
set{var35a,date(20181231,close)}
set{var36a, var35a / var34a}

set{var37a,DATE(20190101,close)}
set{var38a,date(20190131,close)}
set{var39a, var38a / var37a}

/* END 2018 */


dow 30



add column var3{jan_2017}

add column var6{feb_2017}
add column var9{mar_2017}
add column separator
/*add column var12{apr_2017}
add column var15{may_2017}
add column var18{jun_2017}
add column var21{jul_2017}
add column var24{aug_2017}
add column var27{sep_2017}
add column var30{oct_2017}
add column var33(nov_2017}
add column var36{dec_2017}*/


add column var3a{jan_2018}
add column var6a{feb_2018}
add column var9a{mar_2018}
add column separator
/*add column var12a{apr_2018}
add column var15a{may_2018}

add column var18a{jun_2018}
add column var21a{jul_2018}
add column var24a{aug_2018}
add column var27a{sep_2018}
add column var30a{oct_2018}
add column var33a(nov_2018}
add column var36a{dec_2018} */
add column separator
add column var39a{jan_2019}

chart-length 2 years
]



Use look back to first of Feb to catch 1 st week of Feb 2019.

SAFeTRADE
644 posts
msg #146504
Ignore SAFeTRADE
modified
2/10/2019 9:15:56 AM

Here is one with Sectors.

Fetcher[/* Reference a specific date */
set{var1,DATE(20170101,close)}
set{var2,date(20170131,close)}
set{var3, var2 / var1}

set{var4,DATE(20170201,close)}
set{var5,date(20170228,close)}
set{var6, var5 / var4}

set{var7,DATE(20170301,close)}
set{var8,date(20170331,close)}
set{var9, var8 / var7}

set{var10,DATE(20170401,close)}
set{var11,date(20170430,close)}
set{var12, var11 / var10}

set{var13,DATE(20170401,close)}
set{var14,date(20170430,close)}
set{var15, var14 / var13}

set{var16,DATE(20170501,close)}
set{var17,date(20170531,close)}
set{var18, var17 / var16}

set{var19,DATE(20170601,close)}
set{var20,date(20170530,close)}
set{var21, var20 / var19}

set{var22,DATE(20170801,close)}
set{var23,date(20170830,close)}
set{var24, var23 / var22}

set{var25,DATE(20170901,close)}
set{var26,date(20170930,close)}
set{var27, var26 / var25}

set{var28,DATE(20171001,close)}
set{var29,date(20171031,close)}
set{var30, var29 / var28}

set{var31,DATE(20171101,close)}
set{var32,date(20171130,close)}
set{var33, var32 / var31}

set{var34,DATE(20171201,close)}
set{var35,date(20171231,close)}
set{var36, var35 / var34}

/* END 2017 */

set{var1a,DATE(20180101,close)}
set{var2a,date(20180131,close)}
set{var3a, var2a / var1a}

set{var4a,DATE(20180201,close)}
set{var5a,date(20180228,close)}
set{var6a, var5a / var4a}

set{var7a,DATE(20180301,close)}
set{var8a,date(20180331,close)}
set{var9a, var8a / var7a}

set{var10a,DATE(20180401,close)}
set{var11a,date(20180430,close)}
set{var12a, var11a / var10a}

set{var13a,DATE(20180401,close)}
set{var14a,date(20180430,close)}
set{var15a, var14a / var13a}

set{var16a,DATE(20180501,close)}
set{var17a,date(20180531,close)}
set{var18a, var17a / var16a}

set{var19a,DATE(20180601,close)}
set{var20a,date(20180530,close)}
set{var21a, var20a / var19a}

set{var22a,DATE(20180801,close)}
set{var23a,date(20180830,close)}
set{var24a, var23a / var22a}

set{var25a,DATE(20180901,close)}
set{var26a,date(20180930,close)}
set{var27a, var26a / var25a}

set{var28a,DATE(20181001,close)}
set{var29a,date(20181031,close)}
set{var30a, var29a / var28a}

set{var31a,DATE(20181101,close)}
set{var32a,date(20181130,close)}
set{var33a, var32a / var31a}

set{var34a,DATE(20181201,close)}
set{var35a,date(20181231,close)}
set{var36a, var35a / var34a}

set{var37a,DATE(20190101,close)}
set{var38a,date(20190131,close)}
set{var39a, var38a / var37a}

/* END 2018 */


symlist(xlb,xle,xlf,xli,xlk,xlp,xlt,xlu,xlv,xly,spy,gld)



add column var3{jan_2017}

add column var6{feb_2017}
add column var9{mar_2017}
add column separator
/*add column var12{apr_2017}
add column var15{may_2017}
add column var18{jun_2017}
add column var21{jul_2017}
add column var24{aug_2017}
add column var27{sep_2017}
add column var30{oct_2017}
add column var33(nov_2017}
add column var36{dec_2017}*/


add column var3a{jan_2018}
add column var6a{feb_2018}
add column var9a{mar_2018}
add column separator
/*add column var12a{apr_2018}
add column var15a{may_2018}

add column var18a{jun_2018}
add column var21a{jul_2018}
add column var24a{aug_2018}
add column var27a{sep_2018}
add column var30a{oct_2018}
add column var33a(nov_2018}
add column var36a{dec_2018} */
add column separator
add column var39a{jan_2019}

chart-length 2 years
]



jimvin
173 posts
msg #146506
Ignore jimvin
2/10/2019 10:54:32 AM

Speaking of seasonality, this may (or may not) be of interest...

https://www.cxoadvisory.com/trading-calendar/

jm.v.

SAFeTRADE
644 posts
msg #146507
Ignore SAFeTRADE
2/10/2019 11:07:48 AM

Very interesting Jim, thank you.

nibor100
1,031 posts
msg #146508
Ignore nibor100
2/10/2019 11:17:09 AM

If any of you are interested in possibly more ideas on how to use seasonality filters in SF, there are 2 Edgerater Pro videos available on YouTube, "Preview of April Template, Annual Trends" and "Using Seasonality as Part of a Stock Selection Process" .

By the way, the Edgerater Annual Trends/Seasonality templates go from the Open price on the first day to the closing price on the last day for each given time period, 1 month, 2months, 2 weeks, etc.

Ed S.

StockFetcher Forums · Filter Exchange · Here is my 1st shot at a seasonality Filter<< >>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.