Binet's Formula to find Nth Fibonacci Number.
//@version=2 study("Nth Fibonacci Number") //----------------- //Binet's Formula to solve the Nth Fibonacci Number f_n_fib(_step) => _phi = 1.618 _n_phi = 1/_phi _return = round(_step >= 0 ? pow(_phi, _step) / sqrt(5) : pow(-_n_phi, _step) / sqrt(5)) //----------------- step = na(step[1]) ? 1 : n >= f_n_fib(step[1]) ? step[1]+1 : step[1] current_fib = f_n_fib(step) plot(title='Fib Time Number', series=current_fib, color=black)