MOYAR - Month Of Year Average Range

Category: Indicators By: Vonasi Created: December 19, 2018, 4:01 PM
December 19, 2018, 4:01 PM
Indicators
0 Comments

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.

//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"

Download
Filename: MOYAR-Bands.itf
Downloads: 57
Download
Filename: Screenshot_12-2.png
Downloads: 15
Download
Filename: Screenshot_13-1.png
Downloads: 9
Vonasi Master
V-oyaging ON A S-mall I-ncome
Author’s Profile

Comments

Logo Logo
Loading...