Professional Documents
Culture Documents
time
time
///////////////
// Groups
///////////////
gema = '//Other Settings'
g0 = '//Session Settings//'
g1_01 = '// ♯1 SESSION //'
g1_02 = '// ♯2 SESSION //'
g1_03 = '// ♯3 SESSION //'
g1_04 = '// ♯4 SESSION //'
g1_05 = '// ♯5 SESSION //'
g1_06 = '// ♯6 SESSION //'
g1_07 = '// ♯7 SESSION //'
g1_08 = '// ♯8 SESSION //'
g1_09 = '// ♯9 SESSION //'
g1_10 = '// ♯10 SESSION //'
g4 = '// BOX TYPE //'
// Calculate EMAs
ema1 = ta.ema(close, len1)
ema2 = ta.ema(close, len2)
ema3 = ta.ema(close, len3)
ema4 = ta.ema(close, len4)
ema5 = ta.ema(close, len5)
// EMA Plots
plot(ema1, title='EMA 1', style=plot.style_line, linewidth=1, color=ema1color)
plot(ema2, title='EMA 2', style=plot.style_line, linewidth=1, color=ema2color)
plot(ema3, title='EMA 3', style=plot.style_line, linewidth=1, color=ema3color)
plot(ema4, title='EMA 4', style=plot.style_line, linewidth=1, color=ema4color)
plot(ema5, title='EMA 5', style=plot.style_line, linewidth=1, color=ema5color)
insideBar() =>
sib and high <= high[1] and low >= low[1] ? 1 : 0
outsideBar() =>
sob and (high > high[1] and low < low[1]) ? 1 : 0
///////////////
// Defined
///////////////
MAX_BARS = 500
option_yes = 'Yes'
option_no = '× No'
option_border_style1 = '────'
option_border_style2 = '- - - - - -'
option_border_style3 = '•••••••••'
///////////////
// Methods
///////////////
method clear (array<string> id, int _min = 0) =>
if array.size(id) > _min
array.pop(id)
///////////////
// Types
///////////////
// Candle
type Candle
box[] body
line[] wick
Candle candle
this
///////////////
// Functions
///////////////
// Sessions
i_show_sess1 = input.bool(true, 'Session 1 ', group=g1_01,
inline='session1_1') and i_show
i_sess1_label = input.string('08h30', '', group=g1_01,
inline='session1_1')
i_sess1_color = input.color(#66D9EF, 'Box color', group=g1_01,
inline='session1_1')
i_sess1_labelColor = input.color(#FFFFFF, 'Text color', group=g1_01,
inline='session1_1')
i_sess1 = input.session('0830-0831', 'Time', group=g1_01)
i_sess1_max = input.int(300,'Max box size', group=g1_01)
// ------------------------
// ------------------------
// Drawing
// ------------------------
draw (_show, Session data, max_box_size) =>
session = data.session()
col = data.colour
lbcolor = data.lbcolour
name = data.name
var box my_box = na
is_started = f_get_started(session)
if _show and is_started
my_box := box.new(bar_index, low, bar_index, high, col,
i_sess_border_width, i_sess_border_style, bgcolor=color.new(col,
i_sess_box_background ? i_sess_bgopacitys : 100),text = name,text_size = text_size,
text_halign = text_Hali, text_color = lbcolor)
array.push(data.boxes, my_box)
util.clear_boxes(data.boxes, i_history_period)
f_set_box_right(my_box, bar_index + max_box_size)
[session]