Skip to content

Instantly share code, notes, and snippets.

@princefr
Created March 22, 2020 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save princefr/3df7253ce27666d45714138e3d972dc0 to your computer and use it in GitHub Desktop.
Save princefr/3df7253ce27666d45714138e3d972dc0 to your computer and use it in GitHub Desktop.
//@version=3
study("Fibonacci Zone", overlay=true)
per=input(21, "calculate for last ## bars")
hl=highest(high,per) //High Line (Border)
ll=lowest(low,per) //Low Line (Border)
dist=hl-ll //range of the channel
hf=hl-dist*0.236 //Highest Fibonacci line
cfh=hl-dist*0.382 //Center High Fibonacci line
cfl=hl-dist*0.618 //Center Low Fibonacci line
lf=hl-dist*0.764 //Lowest Fibonacci line
fill(plot(hl, title="high border"), plot(hf), color = #00FFFF) //up trend zone
fill(plot(cfh), plot(cfl), color = gray) // ranging zone
fill(plot(ll, title="low border"), plot(lf), color=orange) //down trend zone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment