Fib
Fib
Fib
if globalcoloring == true
DailyColor := GlobalColor
MondayColor := GlobalColor
WeeklyColor := GlobalColor
MonthlyColor := GlobalColor
YearlyColor := GlobalColor
quarterlyColor := GlobalColor
IntraColor := GlobalColor
IntraColor
if weekly_time != weekly_time[1]
untested_monday := false
untested_monday
fontsize = size.small
if labelsize == 'Small'
fontsize := size.small
fontsize
if labelsize == 'Medium'
fontsize := size.normal
fontsize
if labelsize == 'Large'
fontsize := size.large
fontsize
linestyles = line.style_solid
if linestyle == 'Dashed'
linestyles := line.style_dashed
linestyles
if linestyle == 'Dotted'
linestyles := line.style_dotted
linestyles
clondonhigh := 0.0
clondonlow := close
clondonlow
//////////////////////////////////
var cushigh = 0.0
var cuslow = close
var ustime = time
var fushigh = 0.0
var fuslow = 0.0
var fusopen = 0.0
cushigh := 0.0
cuslow := close
cuslow
//////////////////////////////////
var casiahigh = 0.0
var casialow = close
var asiatime = time
var fasiahigh = 0.0
var fasialow = 0.0
var fasiaopen = 0.0
casiahigh := 0.0
casialow := close
casialow
get_limit_right(bars) =>
timenow + (time - time[1]) * bars
/////////////////////////////////
if is_londonrange_enabled
//label.new(bar_index,high)
london_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
label.set_x(londonh_label, london_limit_right)
label.set_y(londonh_label, flondonhigh)
label.set_text(londonh_label, lhtext)
label.set_x(londonl_label, london_limit_right)
label.set_y(londonl_label, flondonlow)
label.set_text(londonl_label, lltext)
label.set_x(londono_label, london_limit_right)
label.set_y(londono_label, flondonopen)
label.set_text(londono_label, lotext)
if mergebool
f_LevelMerge(pricearray, labelarray, flondonhigh,
londonh_label, LondonColor)
f_LevelMerge(pricearray, labelarray, flondonlow,
londonl_label, LondonColor)
f_LevelMerge(pricearray, labelarray, flondonopen,
londono_label, LondonColor)
/////////////////////////////////////////////////////////////////////////
/////////
/////////////////////////////////
if is_usrange_enabled
//label.new(bar_index,high)
us_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
ustime := get_limit_right(radistance)
ustime
line.set_x1(usl_line, ustime)
line.set_x2(usl_line, us_limit_right)
line.set_y1(usl_line, fuslow)
line.set_y2(usl_line, fuslow)
line.set_x1(uso_line, ustime)
line.set_x2(uso_line, us_limit_right)
line.set_y1(uso_line, fusopen)
line.set_y2(uso_line, fusopen)
label.set_x(ush_label, us_limit_right)
label.set_y(ush_label, fushigh)
label.set_text(ush_label, ushtext)
label.set_x(usl_label, us_limit_right)
label.set_y(usl_label, fuslow)
label.set_text(usl_label, usltext)
label.set_x(uso_label, us_limit_right)
label.set_y(uso_label, fusopen)
label.set_text(uso_label, usotext)
if mergebool
f_LevelMerge(pricearray, labelarray, fushigh, ush_label,
USColor)
f_LevelMerge(pricearray, labelarray, fuslow, usl_label,
USColor)
f_LevelMerge(pricearray, labelarray, fusopen, uso_label,
USColor)
/////////////////////////////////
if is_asiarange_enabled
//label.new(bar_index,high)
asia_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
line.set_x1(asial_line, asiatime)
line.set_x2(asial_line, asia_limit_right)
line.set_y1(asial_line, fasialow)
line.set_y2(asial_line, fasialow)
line.set_x1(asiao_line, asiatime)
line.set_x2(asiao_line, asia_limit_right)
line.set_y1(asiao_line, fasiaopen)
line.set_y2(asiao_line, fasiaopen)
label.set_x(asiah_label, asia_limit_right)
label.set_y(asiah_label, fasiahigh)
label.set_text(asiah_label, asiahtext)
label.set_x(asial_label, asia_limit_right)
label.set_y(asial_label, fasialow)
label.set_text(asial_label, asialtext)
label.set_x(asiao_label, asia_limit_right)
label.set_y(asiao_label, fasiaopen)
label.set_text(asiao_label, asiaotext)
if mergebool
f_LevelMerge(pricearray, labelarray, fasiahigh, asiah_label,
AsiaColor)
f_LevelMerge(pricearray, labelarray, fasialow, asial_label,
AsiaColor)
f_LevelMerge(pricearray, labelarray, fasiaopen, asiao_label,
AsiaColor)
/////////////////////////////////////////////////////////////////////////
/////////
/////////////////////////////////////////////////////////////////////////
/////////
if can_draw_intra
intra_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
intra_time := get_limit_right(radistance)
intra_time
line.set_x1(intra_line, intra_time)
line.set_x2(intra_line, intra_limit_right)
line.set_y1(intra_line, intra_open)
line.set_y2(intra_line, intra_open)
label.set_x(intra_label, intra_limit_right)
label.set_y(intra_label, intra_open)
label.set_text(intra_label, iotext)
if mergebool
f_LevelMerge(pricearray, labelarray, intra_open, intra_label,
IntraColor)
/////////////////////////////////////////////////////////////////////////
/////////
//HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH
HIGH HIGH
if can_draw_intrah
intrah_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
intrah_time := get_limit_right(radistance)
intrah_time
line.set_x1(intrah_line, intrah_time)
line.set_x2(intrah_line, intrah_limit_right)
line.set_y1(intrah_line, intrah_open)
line.set_y2(intrah_line, intrah_open)
label.set_x(intrah_label, intrah_limit_right)
label.set_y(intrah_label, intrah_open)
label.set_text(intrah_label, pihtext)
if mergebool
f_LevelMerge(pricearray, labelarray, intrah_open,
intrah_label, IntraColor)
/////////////////////////////////////////////////////////////////////////
/////////
//LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW
if can_draw_intral
intral_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
intral_time := get_limit_right(radistance)
intral_time
line.set_x1(intral_line, intral_time)
line.set_x2(intral_line, intral_limit_right)
line.set_y1(intral_line, intral_open)
line.set_y2(intral_line, intral_open)
label.set_x(intral_label, intral_limit_right)
label.set_y(intral_label, intral_open)
label.set_text(intral_label, piltext)
if mergebool
f_LevelMerge(pricearray, labelarray, intral_open,
intral_label, IntraColor)
/////////////////////////////////////////////////////////////////////////
//////
if can_draw_intram
intram_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
intram_time = intrah_time
intram_open = (intral_open + intrah_open) / 2
if displayStyle == 'Right Anchored'
intram_time := get_limit_right(radistance)
intram_time
var intram_line = line.new(x1=intram_time, x2=intram_limit_right,
y1=intram_open, y2=intram_open, color=IntraColor,
width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var intram_label = label.new(x=intram_limit_right, y=intram_open,
text=pimtext, style=DEFAULT_LABEL_STYLE, textcolor=IntraColor,
size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(intram_line, intram_time)
line.set_x2(intram_line, intram_limit_right)
line.set_y1(intram_line, intram_open)
line.set_y2(intram_line, intram_open)
label.set_x(intram_label, intram_limit_right)
label.set_y(intram_label, intram_open)
label.set_text(intram_label, pimtext)
if mergebool
f_LevelMerge(pricearray, labelarray, intram_open,
intram_label, IntraColor)
////////////////////////////////////////// MONDAY
if is_monday_enabled
monday_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monday_time := get_limit_right(radistance)
monday_time
line.set_x1(monday_line, monday_time)
line.set_x2(monday_line, monday_limit_right)
line.set_y1(monday_line, monday_high)
line.set_y2(monday_line, monday_high)
label.set_x(monday_label, monday_limit_right)
label.set_y(monday_label, monday_high)
label.set_text(monday_label, pmonhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, monday_high,
monday_label, MondayColor)
if is_monday_enabled
monday_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monday_time := get_limit_right(radistance)
monday_time
var monday_low_line = line.new(x1=monday_time,
x2=monday_limit_right, y1=monday_low, y2=monday_low, color=MondayColor,
width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var monday_low_label = label.new(x=monday_limit_right,
y=monday_low, text=pmonltext, style=DEFAULT_LABEL_STYLE,
textcolor=MondayColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(monday_low_line, monday_time)
line.set_x2(monday_low_line, monday_limit_right)
line.set_y1(monday_low_line, monday_low)
line.set_y2(monday_low_line, monday_low)
label.set_x(monday_low_label, monday_limit_right)
label.set_y(monday_low_label, monday_low)
label.set_text(monday_low_label, pmonltext)
if mergebool
f_LevelMerge(pricearray, labelarray, monday_low,
monday_low_label, MondayColor)
if is_monday_mid
mondaym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
/////////////////////////////////////////////////////////////////////////
/////////
////////////////////////DAILY OPEN DAILY OPEN DAILY OPEN DAILY OPEN DAILY
OPEN DAILY OPEN DAILY OPEN
if is_daily_enabled
daily_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
daily_time := get_limit_right(radistance)
daily_time
line.set_x1(daily_line, daily_time)
line.set_x2(daily_line, daily_limit_right)
line.set_y1(daily_line, daily_open)
line.set_y2(daily_line, daily_open)
label.set_x(daily_label, daily_limit_right)
label.set_y(daily_label, daily_open)
label.set_text(daily_label, dotext)
if mergebool
f_LevelMerge(pricearray, labelarray, daily_open, daily_label,
DailyColor)
/////////////////////////////////////////////////////////////////////////
/////////
//////////////////DAILY HIGH DAILY HIGH DAILY HIGH DAILY HIGH DAILY HIGH
DAILY HIGH DAILY HIGH
if is_dailyrange_enabled
dailyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
dailyh_time := get_limit_right(radistance)
dailyh_time
// draw tails before lines for better visual
line.set_x1(dailyh_line, dailyh_time)
line.set_x2(dailyh_line, dailyh_limit_right)
line.set_y1(dailyh_line, dailyh_open)
line.set_y2(dailyh_line, dailyh_open)
label.set_x(dailyh_label, dailyh_limit_right)
label.set_y(dailyh_label, dailyh_open)
label.set_text(dailyh_label, pdhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, dailyh_open,
dailyh_label, DailyColor)
/////////////////////////////////////////////////////////////////////////
/////////
//////////////////DAILY LOW DAILY LOW DAILY LOW DAILY LOW DAILY LOW DAILY
LOW DAILY LOW DAILY LOW
if is_dailyrange_enabled
dailyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
dailyl_time := get_limit_right(radistance)
dailyl_time
line.set_x1(dailyl_line, dailyl_time)
line.set_x2(dailyl_line, dailyl_limit_right)
line.set_y1(dailyl_line, dailyl_open)
line.set_y2(dailyl_line, dailyl_open)
label.set_x(dailyl_label, dailyl_limit_right)
label.set_y(dailyl_label, dailyl_open)
label.set_text(dailyl_label, pdltext)
if mergebool
f_LevelMerge(pricearray, labelarray, dailyl_open,
dailyl_label, DailyColor)
/////////////////////////////////////////////////////////////////////////
/////// Daily MID
if is_dailym_enabled
dailym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
dailym_time = dailyh_time
dailym_open = (dailyl_open + dailyh_open) / 2
if displayStyle == 'Right Anchored'
dailym_time := get_limit_right(radistance)
dailym_time
var dailym_line = line.new(x1=dailym_time, x2=dailym_limit_right,
y1=dailym_open, y2=dailym_open, color=DailyColor,
width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var dailym_label = label.new(x=dailym_limit_right, y=dailym_open,
text=pdmtext, style=DEFAULT_LABEL_STYLE, textcolor=DailyColor,
size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(dailym_line, dailym_time)
line.set_x2(dailym_line, dailym_limit_right)
line.set_y1(dailym_line, dailym_open)
line.set_y2(dailym_line, dailym_open)
label.set_x(dailym_label, dailym_limit_right)
label.set_y(dailym_label, dailym_open)
label.set_text(dailym_label, pdmtext)
if mergebool
f_LevelMerge(pricearray, labelarray, dailym_open,
dailym_label, DailyColor)
/////////////////////////////////////////////////////////////////////////
/////////
if is_weekly_enabled
weekly_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
cweekly_time = weekly_time
if displayStyle == 'Right Anchored'
cweekly_time := get_limit_right(radistance)
cweekly_time
line.set_x1(weekly_line, cweekly_time)
line.set_x2(weekly_line, weekly_limit_right)
line.set_y1(weekly_line, weekly_open)
line.set_y2(weekly_line, weekly_open)
label.set_x(weekly_label, weekly_limit_right)
label.set_y(weekly_label, weekly_open)
label.set_text(weekly_label, wotext)
if mergebool
f_LevelMerge(pricearray, labelarray, weekly_open,
weekly_label, WeeklyColor)
// the weekly open can be the daily open too (monday)
// only the weekly will be draw, in these case we update its
label
// if is_weekly_open and can_show_daily
// label.set_text(weekly_label, "DO / WO ")
/////////////////////////////////////////////////////////////////////////
/////////
/////////////////////////////////////////////////////////////////////////
///////// WEEKLY HIGH WEEKLY HIGH WEEKLY HIGH
if is_weeklyrange_enabled
weeklyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
weeklyh_time := get_limit_right(radistance)
weeklyh_time
var weeklyh_line = line.new(x1=weeklyh_time,
x2=weeklyh_limit_right, y1=weeklyh_open, y2=weeklyh_open,
color=WeeklyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time,
style=linestyles)
var weeklyh_label = label.new(x=weeklyh_limit_right,
y=weeklyh_open, text=pwhtext, style=DEFAULT_LABEL_STYLE,
textcolor=WeeklyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(weeklyh_line, weeklyh_time)
line.set_x2(weeklyh_line, weeklyh_limit_right)
line.set_y1(weeklyh_line, weeklyh_open)
line.set_y2(weeklyh_line, weeklyh_open)
label.set_x(weeklyh_label, weeklyh_limit_right)
label.set_y(weeklyh_label, weeklyh_open)
label.set_text(weeklyh_label, pwhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, weeklyh_open,
weeklyh_label, WeeklyColor)
/////////////////////////////////////////////////////////////////////////
/////////
/////////////////////////////////////////////////////////////////////////
///////// WEEKLY LOW WEEKLY LOW WEEKLY LOW
if is_weeklyrange_enabled
weeklyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
weeklyl_time := get_limit_right(radistance)
weeklyl_time
line.set_x1(weeklyl_line, weeklyl_time)
line.set_x2(weeklyl_line, weeklyl_limit_right)
line.set_y1(weeklyl_line, weeklyl_open)
line.set_y2(weeklyl_line, weeklyl_open)
label.set_x(weeklyl_label, weeklyl_limit_right)
label.set_y(weeklyl_label, weeklyl_open)
label.set_text(weeklyl_label, pwltext)
if mergebool
f_LevelMerge(pricearray, labelarray, weeklyl_open,
weeklyl_label, WeeklyColor)
/////////////////////////////////////////////////////////////////////////
/////////
/////////////////////////////////////////////////////////////////////////
/////// Weekly MID
if is_weekly_mid
weeklym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
weeklym_time = weeklyh_time
weeklym_open = (weeklyl_open + weeklyh_open) / 2
if displayStyle == 'Right Anchored'
weeklym_time := get_limit_right(radistance)
weeklym_time
if is_yearlyrange_enabled
yearlyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
yearlyl_time := get_limit_right(radistance)
yearlyl_time
line.set_x1(yearlyl_line, yearlyl_time)
line.set_x2(yearlyl_line, yearlyl_limit_right)
line.set_y1(yearlyl_line, yearlyl_open)
line.set_y2(yearlyl_line, yearlyl_open)
label.set_x(yearlyl_label, yearlyl_limit_right)
label.set_y(yearlyl_label, yearlyl_open)
label.set_text(yearlyl_label, cyltext)
if mergebool
f_LevelMerge(pricearray, labelarray, yearlyl_open,
yearlyl_label, YearlyColor)
/////////////////////////////////////////////////////////////////////////
/////////
/////////////////////////////////////////////////////////////////////////
///////// YEEEAARRLLYY HIGH HIGH HIGH
if is_yearlyrange_enabled
yearlyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
yearlyh_time := get_limit_right(radistance)
yearlyh_time
line.set_x1(yearlyh_line, yearlyh_time)
line.set_x2(yearlyh_line, yearlyh_limit_right)
line.set_y1(yearlyh_line, yearlyh_open)
line.set_y2(yearlyh_line, yearlyh_open)
label.set_x(yearlyh_label, yearlyh_limit_right)
label.set_y(yearlyh_label, yearlyh_open)
label.set_text(yearlyh_label, cyhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, yearlyh_open,
yearlyh_label, YearlyColor)
/////////////////////////////////////////////////////////////////////////
/////////
/////////////////////////////////////////////////////////////////////////
///////// YEEEAARRLLYY OPEN
if is_yearly_enabled
yearly_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
yearly_time := get_limit_right(radistance)
yearly_time
line.set_x1(yearly_line, yearly_time)
line.set_x2(yearly_line, yearly_limit_right)
line.set_y1(yearly_line, yearly_open)
line.set_y2(yearly_line, yearly_open)
label.set_x(yearly_label, yearly_limit_right)
label.set_y(yearly_label, yearly_open)
label.set_text(yearly_label, yotext)
if mergebool
f_LevelMerge(pricearray, labelarray, yearly_open,
yearly_label, YearlyColor)
/////////////////////////////////////////////////////////////////////////
/////////
/////////////////////////////////////////////////////////////////////////
/////// yearly MID
if is_yearly_mid
yearlym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
yearlym_time = yearlyh_time
yearlym_open = (yearlyl_open + yearlyh_open) / 2
if displayStyle == 'Right Anchored'
yearlym_time := get_limit_right(radistance)
yearlym_time
/////////////////////////////////////////////////////////////////////////
///////// QUATERLLYYYYY OPEN
if is_quarterly_enabled
quarterly_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
quarterly_time := get_limit_right(radistance)
quarterly_time
line.set_x1(quarterly_line, quarterly_time)
line.set_x2(quarterly_line, quarterly_limit_right)
line.set_y1(quarterly_line, quarterly_open)
line.set_y2(quarterly_line, quarterly_open)
label.set_x(quarterly_label, quarterly_limit_right)
label.set_y(quarterly_label, quarterly_open)
label.set_text(quarterly_label, qotext)
if mergebool
f_LevelMerge(pricearray, labelarray, quarterly_open,
quarterly_label, quarterlyColor)
/////////////////////////////////////////////////////////////////////////
/////////
/////////////////////////////////////////////////////////////////////////
///////// QUATERLLYYYYY High
if is_quarterlyrange_enabled
quarterlyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
quarterlyh_time := get_limit_right(radistance)
quarterlyh_time
line.set_x1(quarterlyh_line, quarterlyh_time)
line.set_x2(quarterlyh_line, quarterlyh_limit_right)
line.set_y1(quarterlyh_line, quarterlyh_open)
line.set_y2(quarterlyh_line, quarterlyh_open)
label.set_x(quarterlyh_label, quarterlyh_limit_right)
label.set_y(quarterlyh_label, quarterlyh_open)
label.set_text(quarterlyh_label, pqhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, quarterlyh_open,
quarterlyh_label, quarterlyColor)
/////////////////////////////////////////////////////////////////////////
/////////
/////////////////////////////////////////////////////////////////////////
///////// QUATERLLYYYYY Low
if is_quarterlyrange_enabled
quarterlyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
quarterlyl_time := get_limit_right(radistance)
quarterlyl_time
line.set_x1(quarterlyl_line, quarterlyl_time)
line.set_x2(quarterlyl_line, quarterlyl_limit_right)
line.set_y1(quarterlyl_line, quarterlyl_open)
line.set_y2(quarterlyl_line, quarterlyl_open)
label.set_x(quarterlyl_label, quarterlyl_limit_right)
label.set_y(quarterlyl_label, quarterlyl_open)
label.set_text(quarterlyl_label, pqltext)
if mergebool
f_LevelMerge(pricearray, labelarray, quarterlyl_open,
quarterlyl_label, quarterlyColor)
/////////////////////////////////////////////////////////////////////////
/////////
/////////////////////////////////////////////////////////////////////////
/////// QUATERLLYYYYY MID
if is_quarterly_mid
quarterlym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
quarterlym_time = quarterlyh_time
quarterlym_open = (quarterlyl_open + quarterlyh_open) / 2
if displayStyle == 'Right Anchored'
quarterlym_time := get_limit_right(radistance)
quarterlym_time
var quarterlym_line = line.new(x1=quarterlym_time,
x2=quarterlym_limit_right, y1=quarterlym_open, y2=quarterlym_open,
color=quarterlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time,
style=linestyles)
var quarterlym_label = label.new(x=quarterlym_limit_right,
y=quarterlym_open, text=pqmtext, style=DEFAULT_LABEL_STYLE,
textcolor=quarterlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(quarterlym_line, quarterlym_time)
line.set_x2(quarterlym_line, quarterlym_limit_right)
line.set_y1(quarterlym_line, quarterlym_open)
line.set_y2(quarterlym_line, quarterlym_open)
label.set_x(quarterlym_label, quarterlym_limit_right)
label.set_y(quarterlym_label, quarterlym_open)
label.set_text(quarterlym_label, pqmtext)
if mergebool
f_LevelMerge(pricearray, labelarray, quarterlym_open,
quarterlym_label, quarterlyColor)
/////////////////////////////////////////////////////////////////////////
///////// Monthly LOW LOW LOW
if is_monthlyrange_enabled
monthlyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monthlyl_time := get_limit_right(radistance)
monthlyl_time
line.set_x1(monthlyl_line, monthlyl_time)
line.set_x2(monthlyl_line, monthlyl_limit_right)
line.set_y1(monthlyl_line, monthlyl_open)
line.set_y2(monthlyl_line, monthlyl_open)
label.set_x(monthlyl_label, monthlyl_limit_right)
label.set_y(monthlyl_label, monthlyl_open)
label.set_text(monthlyl_label, pmltext)
if mergebool
f_LevelMerge(pricearray, labelarray, monthlyl_open,
monthlyl_label, MonthlyColor)
// the weekly open can be the daily open too (monday)
// only the weekly will be draw, in these case we update its
label
/////////////////////////////////////////////////////////////////////////
/////////
/////////////////////////////////////////////////////////////////////////
///////// MONTHLY HIGH HIGH HIGH
if is_monthlyrange_enabled
monthlyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monthlyh_time := get_limit_right(radistance)
monthlyh_time
line.set_x1(monthlyh_line, monthlyl_time)
line.set_x2(monthlyh_line, monthlyh_limit_right)
line.set_y1(monthlyh_line, monthlyh_open)
line.set_y2(monthlyh_line, monthlyh_open)
label.set_x(monthlyh_label, monthlyh_limit_right)
label.set_y(monthlyh_label, monthlyh_open)
label.set_text(monthlyh_label, pmhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, monthlyh_open,
monthlyh_label, MonthlyColor)
// the weekly open can be the daily open too (monday)
// only the weekly will be draw, in these case we update its
label
/////////////////////////////////////////////////////////////////////////
/////// MONTHLY MID
if is_monthly_mid
monthlym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
monthlym_time = monthlyh_time
monthlym_open = (monthlyl_open + monthlyh_open) / 2
if displayStyle == 'Right Anchored'
monthlym_time := get_limit_right(radistance)
monthlym_time
var monthlym_line = line.new(x1=monthlym_time,
x2=monthlym_limit_right, y1=monthlym_open, y2=monthlym_open,
color=MonthlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time,
style=linestyles)
var monthlym_label = label.new(x=monthlym_limit_right,
y=monthlym_open, text=pmmtext, style=DEFAULT_LABEL_STYLE,
textcolor=MonthlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(monthlym_line, monthlym_time)
line.set_x2(monthlym_line, monthlym_limit_right)
line.set_y1(monthlym_line, monthlym_open)
line.set_y2(monthlym_line, monthlym_open)
label.set_x(monthlym_label, monthlym_limit_right)
label.set_y(monthlym_label, monthlym_open)
label.set_text(monthlym_label, pmmtext)
if mergebool
f_LevelMerge(pricearray, labelarray, monthlym_open,
monthlym_label, MonthlyColor)
/////////////////////////////////////////////////////////////////////////
/////////
if is_monthly_enabled
monthly_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monthly_time := get_limit_right(radistance)
monthly_time
line.set_x1(monthlyLine, monthly_time)
line.set_x2(monthlyLine, monthly_limit_right)
line.set_y1(monthlyLine, monthly_open)
line.set_y2(monthlyLine, monthly_open)
label.set_x(monthlyLabel, monthly_limit_right)
label.set_y(monthlyLabel, monthly_open)
label.set_text(monthlyLabel, motext)
if mergebool
f_LevelMerge(pricearray, labelarray, monthly_open,
monthlyLabel, MonthlyColor)
/////////////////////////////////////////////////////////////////////////
////
// the monthly open can be the weekly open (monday 1st) and/or
daily open too
// only the monthly will be draw, in these case we update its
label
// if is_monthly_open
// if can_show_daily
// label.set_text(monthlyLabel, "DO / MO ")
// if is_weekly_open
// if can_show_weekly
// label.set_text(monthlyLabel, "WO / MO
")
// if can_show_daily and can_show_weekly
// label.set_text(monthlyLabel, "DO / WO / MO
")
// the start of the line is drew from the first week of the month
// if the first day of the weekly candle (monday) is the 2nd of
the month
// we fix the start of the line position on the Prev weekly
candle
if timeframe.isweekly and dayofweek(monthly_time) !=
dayofweek.monday
line.set_x1(monthlyLine, monthly_time - (weekly_time -
weekly_time[1]))