Rolling Weekly Seasonality % and Gain

v10.3
Rolling Weekly Seasonality % and Gain

This seasonality indicator displays for each week of the year the percentage of up weeks and the average gain per week for each week of the year for a look back period. It can be used to test for any weekly seasonality in any market. Apply it only to the weekly chart of your chosen instrument

Look back periods of 5, 10, 15 and 20 years can be selected.

The histogram represents the percentage of weeks for that particular week number during the look back period where the close was greater than the open. The percentage is also displayed numerically above the histogram. The number under the histogram is the average gain per week for that particular week number during the look back period.

There is a variable called Insignificance Range. This is a percentage straddling 50% that highlights the histogram in blue to show that the number of up weeks in the look back period for that week is not significantly different to 50%. If set to 10 then any week with results from 45% to 55% will be highlighted in blue. Weeks above 55% will be green and those below 45% red.

Because the results are based on a rolling look back period the histogram bar under each candle represents the results at the close of the previous years candle for that week number. If you want to know whether next week has usually been a good week to go long or short then you will need to check the same week number in last years results. So for example if we are currently in week 15 2018 then you would need to look at week 16 2017 to see the analysis for next week. Hover over the indicator to see the week number as it may be different to PRT’s week number displayed on the chart.

If you apply all four indicators (5, 10, 15, 20 year rolling periods) to your weekly chart then you will be able to see if seasonality for any particular week has been strong across all test periods and whether it is getting stronger or weakening. Groups of weeks together can indicate longer periods where it has historically been good to go long or short any particular market.

When using the indicator you need to be wary of week 53’s that occur due to not every year having days that exactly divide into 52. The results for week 53 are not accurate or usable!

The code is very long at 4517 lines due to the lack of arrays at this time in PRT (or maybe just because I am a rather clunky coder! and that’s why it is not post under this description as usually in the library) so I advise downloading and importing the ITF file to get full functionality.

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Vonasi • 11/15/2018 #

    Note: This indicator requires at least 20 years of weekly data to calculate. Instruments with less than 20 years of weekly data will not calculate correctly.

  2. m-zeter • 11/15/2018 #

    Every interesting code Vonasi. I have one question. It seems, that it only works in the weekly time unit. I am not a big coder like you, so i ask myself, if it is possible, that this indicator works with shorter time units like one day or one hour. What should be changed in the code?

  3. Vonasi • 11/15/2018 #

    The code resets at the start of a year and then stores data for the last 20 sets of 53 bars so it will not work on other time periods. It was purely written to try to see if their is any benefit in using rolling weekly seasonality as a filter. Personally I cannot see how testing for seasonality in faster time periods than a week would be of much use in trading any way.

  4. pableitor • 11/15/2018 #

    Amazing work !! Thanks !

  5. Vonasi • 11/15/2018 #

    No problem pableitor – I’m glad you like it.

  6. pableitor • 11/15/2018 #

    Hi Vonasi, I was checking a few random weeks with your indicator and sometimes it seems to be wrong. For instance the SP500 on a 5 year lookback period on w41 2018 gives an 80% up probability but w41 was up on 2013, 15 &17 and down on 2014 & 16 which means the result should be 60% on w41 doesnt it ?

  7. Vonasi • 11/15/2018 #

    I have not checked your query on a chart but my guess is that you are reading the indicator incorrectly. If it is 2018 and you want to know how this week performed in the last 5 years in week 41 then you have to look at the result under week 41 2017. If week 41 2018 has closed out then the result under it will be calculated using 2014 to 2018 inclusive. I’m guessing then that 2018 was an up week giving you your 80% as 2014 would be the only down week in that data set.

avatar
Register or

Likes

avatar avatar avatar avatar avatar
Related users ' posts
Paris On est bien d accord que l indicateur repeint ....
Nicolas naturellement si la bougie du timeframe supérieur n'est pas terminé
ThePenntChemist Does this show 5min time frame?
JohnScher I've been looking for this for a long time! A very big thank you to you.
Nupsator hi, looks very interesting, i imported the indicator and inserted it into a 1h chart. Unfort...
Ciccarelli Franco Lo trovo interessante, ma non riesco a scaricarlo. Chi mi può aiutare?
klaus_reum Many thanks for that great tool. nevertheless, I am struggling with the time range. I tried ...
ipbvba idem ne fonctionne pas sur V11 (meme avec real time data), import OK mais aucune courbe dans...
Ciccarelli Franco I'm new to the Market, I imported the code, but I don't see anything, there is an empty box ...
Giogio hello dear Vonasi, thank you for your indicator, can I ask you for some help in order to let...
Pottar24 HI Vonasi I would like to know how can this algorithm give me the value of the last max e mi...
parthapersonal Hello Vonasi, Great work. Is it possible to replicate this to get values of "Price Line" (1...
tobytarczy Hi Vonasi, Sounds lovely, I race yachts around europe myself. Most regattas cancelled unfor...
mlouys Hello Vonasi thank for your work ! A question how can we do it for minutes ( or 15 min or x ...
Vonasi I think that would be possible but probably in a whole new indicator as detecting when a new...
SL Hi, Fer666 Thank you for sharing. If I want to show daily ST on a 10_min intraday chart...
SL correction above... system had remove"not equal" signs Line 19 : change to if WeekNo "Not...
SL OK... I had figured out... need more than that. Thank you anyway.
Vonasi That should be possible - I'll add it to my list to work on!
thierrybl Thanks a lot
B-ling1 Hi Vonasi, I love this indicator - good job! Just one question: If I want the monthly OHLC L...
ALE Very Very Nice
manel Hi - Many thanks for this and your other analytical codes, stellar work - very useful ! With...
Vonasi Good idea Manel. I have posted a new version here that shows results as a percentage: https:...
Vonasi Thanks for the compliments ALE. If you use any results from it in a strategy then please sha...
CKW this is Awesome tool. thanks Vonasi
Vonasi ....and thank you for the compliment CKW.
Reiner great work:-)
Vonasi Thanks Reiner. that is compliments indeed from the seasonality expert. I have a second vers...
Sagal Hi Vonasi, Can it be presented as a 1 year graph displaying a 5 year average or 10 year aver...
Yannick TradingDayLong = dayofweek = 1 or dayofweek = 2 or dayofweek = 3 or dayofweek = 4 or dayof...
Marlon Hey JohnScher, your code works fine, but my results aren't as good as yours. Even if I use ...
DarioMazza Bha... this code dont work. gg
haseluis Hello, who can help me why the screener does not work // Der folgende Code bezieht sich auf...
Nicolas Hello, please ask your question with a new forum topic, this is not the place to ask for sup...
Nicolas Thanks for contributing to the "ichimoku section" of the prorealtime code library Don't he...
sourberry Thank you , this is a great indicator works beautifully. Could you kindly modify to scr...
pp_playaflamenca Excuse me,... reading your code about spanB: [ SenkouSpanBFutureW = (Highest[SenkouSpanPerio...
Reiner
8 years ago
Nicolas You should join and read the forum thread about this strategy. There are plenty of different...
Reiner Hi djtaktik and welcome, I have answered your question in the related Pathfinder forum beca...
danver34 is this version the definitive one or from the original one have there been modifications to...
Doctrading Thanks, man !
rajiwas How is it possible to add currentWeekHigh and currentWeekLow, currentWeekOpen and currentWee...
Takeshi Totally don't match the PRT basic pivots on weekly

Top