HV
HV
0 at
https://mozilla.org/MPL/2.0/
// © DevLucem
// you can request code usage by messaging me
//@version=5
////////
// Preheat Oven
// [
indicator('Semafor', overlay=true, max_labels_count=300)
// ]
////////
// Bake Water With Vinegar For 20 Minutes
// [
repaint = input(false, 'Allow Drawing Of Unconfirmed Levels')
zigzag(Depth, Deviation, Color, Size, Type) =>
var lw = 1
var hg = 1
lw += 1
hg += 1
p_lw = -ta.lowestbars(Depth)
p_hg = -ta.highestbars(Depth)
lowing = lw == p_lw or low - low[p_lw] > Deviation * syminfo.mintick
highing = hg == p_hg or high[p_hg] - high > Deviation * syminfo.mintick
lh = ta.barssince(not highing)
ll = ta.barssince(not lowing)
down = lh > ll
lower = low[lw] > low[p_lw]
higher = high[hg] < high[p_hg]
if lw != p_lw and (not down[1] or lower)
lw := p_lw < hg ? p_lw : 0
lw
if hg != p_hg and (down[1] or higher)
hg := p_hg < lw ? p_hg : 0
hg
x1 = down ? lw : hg
y1 = down ? low[lw] : high[hg]
lb = down ? label.style_label_up : label.style_label_down
label point = na
if repaint
point := label.new(bar_index - x1, y1, color=Color,
style=label.style_circle, size=Size)
if down == down[1]
label.delete(point[1])
if not repaint and down != down[1]
nx = down ? hg : lw
point := label.new(bar_index - nx, down ? high[nx] : low[nx], color=Color,
style=label.style_circle, size=Size)
point
down != down[1]
// ]
////////
// Serve While Hot
// [
switch_1 = false
if input(true, 'X-Large')
switch_1 := zigzag(input(615, 'Depth'), input(36.0, 'Deviation'),
input(color.yellow, 'Color'), size.huge, 'X-Large') or switch_1
switch_1
if input(true, 'Large')
switch_1 := zigzag(input(150, 'Depth'), input(24.0, 'Deviation'),
input(#f9f3f3, 'Color'), size.large, 'Large') or switch_1
switch_1
if input(true, 'Medium')
switch_1 := zigzag(input(41, 'Depth'), input(6.0, 'Deviation'), input(#2b00ff,
'Color'), size.small, 'Medium') or switch_1
switch_1
if input(false, 'X-Small')
switch_1 := zigzag(input(10, 'Depth'), input(3.0, 'Deviation'), input(#090909,
'Color'), size.tiny, 'Small') or switch_1
// ]
////////
// Monchoka Juu Unajinauwo
// [
daily_open(x) =>
trigger = na(time('D')) or ta.change(time('D'))
ta.valuewhen(trigger, open, x)
//Functions
daily_calc() =>
[day_one_high, day_one_low] = request.security(ticker.new(syminfo.prefix,
syminfo.ticker), res, [high[1], low[1]], lookahead = barmerge.lookahead_on)
[day_two_high, day_two_low] = request.security(ticker.new(syminfo.prefix,
syminfo.ticker), res, [high[2], low[2]], lookahead = barmerge.lookahead_on)
[day_three_high, day_three_low] = request.security(ticker.new(syminfo.prefix,
syminfo.ticker), res, [high[3], low[3]], lookahead = barmerge.lookahead_on)
[day_four_high, day_four_low] = request.security(ticker.new(syminfo.prefix,
syminfo.ticker), res, [high[4], low[4]], lookahead = barmerge.lookahead_on)
[day_five_high, day_five_low] = request.security(ticker.new(syminfo.prefix,
syminfo.ticker), res, [high[5], low[5]], lookahead = barmerge.lookahead_on)
yesterday_calc() =>
[day_one_high, day_one_low] = request.security(ticker.new(syminfo.prefix,
syminfo.ticker), res, [high[1], low[1]], lookahead = barmerge.lookahead_on)
yesterday_adr() =>
[day_one_high, day_one_low] = request.security(ticker.new(syminfo.prefix,
syminfo.ticker), res, [high[2], low[2]], lookahead = barmerge.lookahead_on)
[day_two_high, day_two_low] = request.security(ticker.new(syminfo.prefix,
syminfo.ticker), res, [high[3], low[3]], lookahead = barmerge.lookahead_on)
[day_three_high, day_three_low] = request.security(ticker.new(syminfo.prefix,
syminfo.ticker), res, [high[4], low[4]], lookahead = barmerge.lookahead_on)
[day_four_high, day_four_low] = request.security(ticker.new(syminfo.prefix,
syminfo.ticker), res, [high[5], low[5]], lookahead = barmerge.lookahead_on)
[day_five_high, day_five_low] = request.security(ticker.new(syminfo.prefix,
syminfo.ticker), res, [high[6], low[6]], lookahead = barmerge.lookahead_on)
nround(x) =>
n = math.round(x / syminfo.mintick) * syminfo.mintick
pip_to_whole(number) =>
atr = ta.atr(14)
if syminfo.type == 'forex'
pips = atr < 1.0 ? (number / syminfo.mintick) / 10 : number
pips := atr >= 1.0 and atr < 100.0 and (syminfo.currency == 'JPY' or
syminfo.currency == 'HUF' or syminfo.currency == 'INR') ? pips * 100 : pips
else if syminfo.type == 'crypto'
pips = atr < 1.0 ? (number / syminfo.mintick) / 10 : number
pips := atr >= 1.0 ? pips * 100 : pips
else
number
//Function Calls
adr = daily_calc()
adr_pips = pip_to_whole(adr)
adr_pips := math.round(adr_pips)
y_move = yesterday_calc()
y_move_pips = pip_to_whole(y_move)
y_move_pips := math.round(y_move_pips)
y_move_75 = yesterday_adr()
y_move_p = pip_to_whole(y_move_75)
y_move_p := math.round(y_move_p)
y_move_75_pips = y_move_p * 0.75
y_move_75_pips := math.round(y_move_75_pips)
//Labels
var label label_t1_open = na
var label label_high_100 = na
var label label_high_75 = na
var label label_high_50 = na
var label label_high_25 = na
var label label_high_15 = na
var label label_low_15 = na
var label label_low_25 = na
var label label_low_50 = na
var label label_low_75 = na
var label label_low_100 = na
//Labels
label_t1_open := label.new(last_bar_time, dopen, size = size.normal, text
= ' ' + 'Open | ' + str.tostring(dopen,
format.mintick), style = label.style_none, textcolor = color.new(color.white, 10),
xloc = xloc.bar_time)
label_high_100 := label.new(last_bar_time, high_100_p, size = size.normal, text
= ' ' + '100% | ' +
str.tostring(math.round(adr_pips)) + ' Pips' + ' | ' + str.tostring(high_100_p,
format.mintick), style = label.style_none, textcolor = color.new(#5bd50f, 10), xloc
= xloc.bar_time)
label_high_75 := label.new(last_bar_time, high_75_p, size = size.normal, text
= ' ' + '75% | ' +
str.tostring(math.round(adr_pips * 0.75)) + ' Pips' + ' | ' +
str.tostring(high_75_p, format.mintick), style = label.style_none, textcolor =
color.new(#5bd50f, 10), xloc = xloc.bar_time)
label_high_50 := label.new(last_bar_time, high_50_P, size = size.normal, text
= ' ' + '50% | ' +
str.tostring(math.round(adr_pips * 0.50)) + ' Pips' + ' | ' +
str.tostring(high_50_P, format.mintick), style = label.style_none, textcolor =
color.new(#5bd50f, 10), xloc = xloc.bar_time)
label_high_25 := label.new(last_bar_time, high_25_p, size = size.normal, text
= ' ' + '25% | ' +
str.tostring(math.round(adr_pips * 0.25)) + ' Pips' + ' | ' +
str.tostring(high_25_p, format.mintick), style = label.style_none, textcolor =
color.new(#5bd50f, 10), xloc = xloc.bar_time)
label_high_15 := label.new(last_bar_time, high_15_p, size = size.normal, text
= ' ' + '15% | ' +
str.tostring(math.round(adr_pips * 0.15)) + ' Pips' + ' | ' +
str.tostring(high_15_p, format.mintick), style = label.style_none, textcolor =
color.new(#5bd50f, 10), xloc = xloc.bar_time)
label_low_15 := label.new(last_bar_time, low_15_p, size = size.normal, text
= ' ' + '15% | ' +
str.tostring(math.round(adr_pips * 0.15)) + ' Pips' + ' | ' +
str.tostring(low_15_p, format.mintick), style = label.style_none, textcolor =
color.new(#ea2700, 10), xloc = xloc.bar_time)
label_low_25 := label.new(last_bar_time, low_25_p, size = size.normal, text
= ' ' + '25% | ' +
str.tostring(math.round(adr_pips * 0.25)) + ' Pips' + ' | ' +
str.tostring(low_25_p, format.mintick), style = label.style_none, textcolor =
color.new(#ea2700, 10), xloc = xloc.bar_time)
label_low_50 := label.new(last_bar_time, low_50_p, size = size.normal, text
= ' ' + '50% | ' +
str.tostring(math.round(adr_pips * 0.50)) + ' Pips' + ' | ' +
str.tostring(low_50_p, format.mintick), style = label.style_none, textcolor =
color.new(#ea2700, 10), xloc = xloc.bar_time)
label_low_75 := label.new(last_bar_time, low_75_p, size = size.normal, text
= ' ' + '75% | ' +
str.tostring(math.round(adr_pips * 0.75)) + ' Pips' + ' | ' +
str.tostring(low_75_p, format.mintick), style = label.style_none, textcolor =
color.new(#ea2700, 10), xloc = xloc.bar_time)
label_low_100 := label.new(last_bar_time, low_100_p, size = size.normal, text
= ' ' + '100% | ' +
str.tostring(math.round(adr_pips)) + ' Pips' + ' | ' + str.tostring(low_100_p,
format.mintick), style = label.style_none, textcolor = color.new(#ea2700, 10), xloc
= xloc.bar_time)
//Delete Label
label.delete(label_t1_open[1])
label.delete(label_high_100[1])
label.delete(label_high_75[1])
label.delete(label_high_50[1])
label.delete(label_high_25[1])
label.delete(label_high_15[1])
label.delete(label_low_15[1])
label.delete(label_low_25[1])
label.delete(label_low_50[1])
label.delete(label_low_75[1])
label.delete(label_low_100[1])
//Delete Line
line.delete(tl[1])
line.delete(high_100[1])
line.delete(high_75[1])
line.delete(high_50[1])
line.delete(high_25[1])
line.delete(high_15[1])
line.delete(low_15[1])
line.delete(low_25[1])
line.delete(low_50[1])
line.delete(low_75[1])
line.delete(low_100[1])
// ( (
// )\ ) )\ )
// (()/( ( ) (()/( ( ( )
// /(_)) ))\ /(( /(_)) ))\ ( ))\ (
// (_))_ /((_)(_))\ (_)) /((_) )\ /((_) )\ '
// | \ (_)) _)((_) | | (_))( ((_)(_)) _((_))
// | |) |/ -_) \ V / | |__| || |/ _| / -_)| ' \()
// |___/ \___| \_/ |____|\_,_|\__| \___||_|_|_|