Skip to content

Instantly share code, notes, and snippets.

@mhddurrah
Created April 10, 2023 10:17
Show Gist options
  • Save mhddurrah/9c324de633b8f7ce5e5b5c31e21a480d to your computer and use it in GitHub Desktop.
Save mhddurrah/9c324de633b8f7ce5e5b5c31e21a480d to your computer and use it in GitHub Desktop.
//@version=5
indicator("Nouronacci", overlay=true)
offset = input.int(defval=0,title="Offset", minval = 0)
show_labels = input.bool(defval=false,title="Show Labels")
timeframe = input.timeframe(defval = "", title = "Timeframe")
h = float(high[offset])
l = float(low[offset])
m = float((h+l)/2)
m1 = float((h+m)/2)
m2 = float((l+m)/2)
var line highLine = na
var line lowLine = na
var line midLine = na
var line mid1Line = na
var line mid2Line = na
var label highLabel = na
var label mid1Label = na
dt = time - time[1]
if barstate.islast
label.new(time[offset], h, "", xloc=xloc.bar_time, yloc = yloc.belowbar, color=color.gray, style=label.style_arrowup)
highLine := line.new(x1=bar_index[0], y1=h, x2=bar_index[1], y2=h, extend=extend.both, color=color.blue,width=2)
if(show_labels)
label.new(time + 5*dt, h, str.tostring(h),xloc=xloc.bar_time, color=color.blue)
mid1Line := line.new(x1=bar_index[0], y1=m1, x2=bar_index[1], y2=m1, extend=extend.both, color=color.green,width=2)
if(show_labels)
label.new(time + 5*dt, m1, str.tostring(m1),xloc=xloc.bar_time, color=color.green)
midLine := line.new(x1=bar_index[0], y1=m, x2=bar_index[1], y2=m, extend=extend.both, color=color.red,width=2)
if(show_labels)
label.new(time + 5*dt, m, str.tostring(m),xloc=xloc.bar_time, color=color.red)
mid2Line := line.new(x1=bar_index[0], y1=m2, x2=bar_index[1], y2=m2, extend=extend.both, color=color.green,width=2)
if(show_labels)
label.new(time + 5*dt, m2, str.tostring(m2),xloc=xloc.bar_time, color=color.green)
lowLine := line.new(x1=bar_index[0], y1=l, x2=bar_index[1], y2=l, extend=extend.both, color=color.blue,width=2)
if(show_labels)
label.new(time + 5*dt, l, str.tostring(l),xloc=xloc.bar_time, color=color.blue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment