TradingView
LonesomeTheBlue
Dec 21, 2021 6:44 PM

Fibonacci levels MTF 

Bitcoin / TetherUSBinance

Description

Hello All,

I got some requests for a script that shows Fibonacci Levels of Higher Time Frame Candles. so I made/published this script. I hope it would be useful for you.

Options:
You can set Higher Time Frame, by default it's 1 Day.
Optionally it can use Current or Last Candle of higher time frame to calculate/show its Fibonacci Levels.
It can show higher time frame candles at the background optionally. You can change its colors.
You can enable/disable/change each Fibonacci levels and their colors.
You can enable/disable Fibonacci Labels that is shown at the right ride and see only Fibonacci lines/levels

example, Fibonacci levels with higher time frame candles:


P.S. if you have ideas to improve this script, drop a comment under the script please


Enjoy!
Comments
RodrigoKazuma
Great job!! Congrats!!

I took the liberty of making a logarithmic scale version; please feel free to use it, and change it in your way, and rip off my name. 😅

The TV doesn't allow me to post the whole script here, but you can add this line to your script:

i_log = input.bool(false, "Use Logarithmic Scale?") // @function Get Value and convert or not their Natural Logarithm // @param _value Source value // @returns The original or the Natural Logarithm of the _value getVal(_value)=> output = i_log ? math.log(_value): _value // @function Set Value back to right Scale // @param _value Source value // @returns Set the _value to the right scale setVal(_value)=> output = i_log ? math.exp(_value) : _value v_open = getVal(open) v_high = getVal(high) v_low = getVal(low) v_close = getVal(close)


Then add the "v_" in front of open, high, low, close sources;
And put the function setVal() in every drawing output.

In any case, here is the full script for you to copy, test, and modify:

heypasteit.com/clip/0IY133

Obs: I don't know how long the heypasteit keep the files, so try to copy as soon as possible.
😅👍
RodrigoKazuma
@RodrigoKazuma, I made a minor modification to fix the plot Candles:

heypasteit.com/clip/0IY136
MaximusGains

Problem with the line 122 any fixes thank you in advance
RodrigoKazuma
Hey @MaximusGains , try this:

float mid = (high_ + low_) / 2
MaximusGains
@RodrigoKazuma, ManyThanks' worded 👀🦾
ukmpits
@MaximusGains, Hello Sir, would you mind to share us full code , that improved by rodrigokazuma? Here or via github you can post here.. Thanks mate
abrekgorkii
@RodrigoKazuma, I have a problem. ( line 122: Syntax error at input 'high_'. )
RodrigoKazuma
@abrekgorkii, Thanks for the report!

Try the code here: cl1p.net/FibonacciLevelsMTF
abrekgorkii
@RodrigoKazuma, it worked now. thanks
More