This indicator is a further adaptation of my DOWAR – Day Of Week Average Range Bands and HODAR – Hour Of Day Average Range Bands indicators that can be found here:
https://www.prorealcode.com/prorealtime-indicators/dowar-day-of-week-average-range-bands/
https://www.prorealcode.com/prorealtime-indicators/hodar-hour-of-day-average-range-bands/
This version calculates an all time average range for each month of the year and then applies it to the chart as bands or a background candle or both. So for example on January candles the bands (or background candle) will represent the all time average range for all recorded months of January up to that date.
The bands/candles can be made wider or narrower by adjusting the ‘Multiple’ setting.
The centre of the bands/candles can be based on any custom close such as median price, close, typical price, total price etc.
By adjusting the offset you can decide which months custom close the bands/candles will be centred on. Zero = this month’s, 1 = the previous month’s etc.
You can set the start date from when the indicator should start calculating the monthly averages. Set StartDate to zero if you want to use all available history.
Apply the indicator only to the monthly price chart.
I recommend that you download the itf file and import it to get full functionality rather than cut and pasting the code.
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
//MOYAR Bands - Month Of Year Average Range Bands //By Vonasi //20181219 //Multiple = 1 //Offset = 1 //Bands = 0 //Candles = 1 //StartDate = 0 if opendate >= StartDate or startdate = 0 then IF openmonth = 1 THEN H1 = (H1 + (High - Low)) H1Count = (H1Count + 1) ThisMonth = (H1 / H1Count) ELSIF openmonth = 2 THEN H2 = (H2 + (High - Low)) H2Count = (H2Count + 1) ThisMonth = (H2 / H2Count) ELSIF openmonth = 3 THEN H3 = (H3 + (High - Low)) H3Count = (H3Count + 1) ThisMonth = (H3 / H3Count) ELSIF openmonth = 4 THEN H4 = (H4 + (High - Low)) H4Count = (H4Count + 1) ThisMonth = (H4 / H4Count) ELSIF openmonth = 5 THEN H5 = (H5 + (High - Low)) H5Count = (H5Count + 1) ThisMonth = (H5 / H5Count) ELSIF openmonth = 6 THEN H6 = (H6 + (High - Low)) H6Count = (H6Count + 1) ThisMonth = (H6 / H6Count) ELSIF openmonth = 7 THEN H7 = (H7 + (High - Low)) H7Count = (H7Count + 1) ThisMonth = (H7 / H7Count) ELSIF openmonth = 8 THEN H8 = (H8 + (High - Low)) H8Count = (H8Count + 1) ThisMonth = (H8 / H8Count) ELSIF openmonth = 9 THEN H9 = (H9 + (High - Low)) H9Count = (H9Count + 1) ThisMonth = (H9 / H9Count) ELSIF openmonth = 10 THEN H10 = (H10 + (High - Low)) H10Count = (H10Count + 1) ThisMonth = (H10 / H10Count) ELSIF openmonth = 11 THEN H11 = (H11 + (High - Low)) H11Count = (H11Count + 1) ThisMonth = (H11 / H11Count) ELSIF openmonth = 12 THEN H12 = (H12 + (High - Low)) H12Count = (H12Count + 1) ThisMonth = (H12 / H12Count) ENDIF upper = customclose[offset] + ((ThisMonth * multiple)/2) lower = customclose[offset] - ((ThisMonth * multiple)/2) if candles then drawcandle(lower,upper,lower,upper) COLOURED(100,149,237,20) BORDERCOLOR(0,0,0,100) endif c = 0 if bands then c = 255 endif else upper = close lower = close c = 0 endif RETURN upper coloured (100,149,237,c) style(line, 1) as "Upper Band", lower coloured (100,149,237,c) style(line, 1) as "Lower Band" |
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