This indicator is a further adaptation of the most-active-days-range indicator that can be found here:
https://www.prorealcode.com/prorealtime-indicators/monthly-weekly-and-daily-activity-and-equity/
This version calculates an all time average range for each day of the week and then applies it to the chart as bands or a background candle or both. So for example on Monday candles the bands (or background candle) will represent the all time average range for all recorded Mondays in history 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 days custom close the bands/candles will be centred on. zero = todays, 1 = yesterdays etc.
You can set the start date from when the indicator should start calculating the daily averages. Set StartDate to zero if you want to use all available history.
Apply the indicator only to the daily 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 |
//DOWAR Bands - Day Of Week Average Range Bands //By Vonasi //20181219 //Multiple = 1 //Offset = 1 //Bands = 0 //Candles = 1 //StartDate = 0 if opendate >= StartDate or startdate = 0 then IF opendayofweek = 0 THEN W0 = (W0 + (High - Low)) W0Count = (W0Count + 1) ThisDay = (W0 / W0Count) ELSIF opendayofweek = 1 THEN W1 = (W1 + (High - Low)) W1Count = (W1Count + 1) ThisDay = (W1 / W1Count) ELSIF opendayofweek = 2 THEN W2 = (W2 + (High - Low)) W2Count = (W2Count + 1) ThisDay = (W2 / W2Count) ELSIF opendayofweek = 3 THEN W3 = (W3 + (High - Low)) W3Count = (W3Count + 1) ThisDay = (W3 / W3Count) ELSIF opendayofweek = 4 THEN W4 = (W4 + (High - Low)) W4Count = (W4Count + 1) ThisDay = (W4 / W4Count) ELSIF opendayofweek = 5 THEN W5 = (W5 + (High - Low)) W5Count = (W5Count + 1) ThisDay = (W5 / W5Count) endif upper = customclose[offset] + ((ThisDay * multiple)/2) lower = customclose[offset] - ((ThisDay * 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
Thats Awesome thank you
Thanks Vonasi !