Skip to content

Instantly share code, notes, and snippets.

@mhddurrah
Last active October 5, 2021 20:16
Show Gist options
  • Save mhddurrah/868641ce71cc1f9b01e068b7ffe60746 to your computer and use it in GitHub Desktop.
Save mhddurrah/868641ce71cc1f9b01e068b7ffe60746 to your computer and use it in GitHub Desktop.
//@version=4
study("Nouronacci", overlay=true)
offset = input(title="Offset", type=input.integer, defval=0, minval=-0, maxval=10)
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
highLine := line.new(x1=bar_index[0], y1=h, x2=bar_index[1], y2=h, extend=extend.both, color=color.blue,width=2)
label.new(time + 5*dt, h, 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)
label.new(time + 5*dt, m1, 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)
label.new(time + 5*dt, m, 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)
label.new(time + 5*dt, m2, 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)
label.new(time + 5*dt, l, 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