This little indicator simply checks on the first day of a month whether the previous month closed higher or lower and counts the runs of up months and the runs of down months .
It then also calculates how many months in a row on average the market went up before it had a down month and the opposite average for down months.
It also records the longest ever run for up months and longest ever run for down months.
Knowing at a glance how many months up or down we have recently had compared to historical monthly bullish or bearish runs and comparing how far we are into a run compared to when a change of direction usually takes place can be useful information when taking an overview of current market conditions. This indicator allows us to see that information at a glance without needing to refer to a monthly chart.
I recommend applying it to the daily chart although it will work on faster time frames. On faster time frames the amount of history available may make the output a little meaningless though.
As always I advise downloading and importing the ITF file to get full functionality.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
if openmonth <> openmonth[1] then myopen = open myclose = close[1] diff = myclose - myopen[1] if myclose <> 0 and myopen[1] <> 0 then if diff > 0 and diff[1] < 0 then flag = 1 endif if diff < 0 and diff[1] > 0 then flag = -1 endif if diff > 0 and diff[1] > 0 then flag = flag + 1 endif if diff < 0 and diff[1] < 0 then flag = flag - 1 endif endif maxdown = min(flag, maxdown) maxup = max(flag,maxup) if flag < 0 and flag[1] > 0 then up = up + flag[1] upcount = upcount + 1 endif if flag > 0 and flag[1] < 0 then down = down + flag[1] downcount = downcount + 1 endif upave = up/upcount downave = down/downcount endif return flag as "Month Up or Down", maxup as "Longest ever up run",maxdown as "Longest ever down run", upave as "Avg months up before a down",downave as "Avg months down before an up" |
Share this
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 :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Very interesting for monthly stock market strategies, thank you Vonasi! 🙂