OPEN-SOURCE SCRIPT
[e2] Fibonacci, Tribonacci, Tetranacci Sequence Calculator

The script is a simple calculator to obtain numbers of Fibonacci, Tribonacci or Tetranacci Sequence.
The script contain calculations for constants (up to 16 digits) that could be used as one of the sequence's number.
The Calculator has 3 modes. Users can define the numbers to initialize the sequence in the options:
- The Fibonacci Sequence is the series of numbers, every next number is found by adding up the two numbers before it.
- The Tribonacci Sequence is the series of numbers, every next number is found by adding up the three numbers before it.
- The Tetranacci Sequence is the series of numbers, every next number is found by adding up the four numbers before it.
The Calculator can return a single number or a set of numbers based on the selected sequence mode.
The script is made for other scripts integration rather than stand-alone usage.

The script contain calculations for constants (up to 16 digits) that could be used as one of the sequence's number.
The Calculator has 3 modes. Users can define the numbers to initialize the sequence in the options:
- The Fibonacci Sequence is the series of numbers, every next number is found by adding up the two numbers before it.
Pine Script®
xn = xn-1 + xn-2
fiConst variable = Fibonacci Constant(Golden Ratio) - 1.61803...
"Classic" Sequence initialize with numbers {0, 1}. Output: 1,2,3,5,8,13,21...
To Calculate the Fibonacci Extensions the sequence should be initialized with {1, fiConst}. Output: 2.618, 4.236, 6.854...
- The Tribonacci Sequence is the series of numbers, every next number is found by adding up the three numbers before it.
Pine Script®
xn = xn-1 + xn-2 + xn-3
trConst variable = Tribonacci Constant - 1.83929...
"Classic" Sequence initialize with numbers {0, 0, 1}. Output: 1,2,4,7,13,24...
To Calculate the Tribonacci Extensions the sequence should be initialized with {0, 1, trConst}. Output: 2.839, 5.679, 10.357...
- The Tetranacci Sequence is the series of numbers, every next number is found by adding up the four numbers before it.
Pine Script®
xn = xn-1 + xn-2 + xn-3 + xn-4
teConst variable = Tetranacci Constant - 1.92756...
"Classic" Sequence initialize with numbers {0, 0, 0, 1}. Output: 1,2,4,8,15,29,56...
To Calculate the Tetranacci Extensions the sequence should be initialized with {0, 0, 1, teConst}. Output: 2.928, 5.855, 11.710...
The Calculator can return a single number or a set of numbers based on the selected sequence mode.
The script is made for other scripts integration rather than stand-alone usage.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Para acesso rápido no gráfico, adicione esse script para seus favoritos — saiba mais aqui.
Pisces swimming through the river
All their life against the stream
Searching for a hook to catch on
And see their sun beam
Then suffocate in painful tortures
On cutting tables of callous men
Under a knife of handsome butchers
Emeralds are ripped away
All their life against the stream
Searching for a hook to catch on
And see their sun beam
Then suffocate in painful tortures
On cutting tables of callous men
Under a knife of handsome butchers
Emeralds are ripped away
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script de código aberto
No verdadeiro espirito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam entendê-lo e verificá-lo. Parabéns ao autor Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações e regida pelas Regras da Casa.
Para acesso rápido no gráfico, adicione esse script para seus favoritos — saiba mais aqui.
Pisces swimming through the river
All their life against the stream
Searching for a hook to catch on
And see their sun beam
Then suffocate in painful tortures
On cutting tables of callous men
Under a knife of handsome butchers
Emeralds are ripped away
All their life against the stream
Searching for a hook to catch on
And see their sun beam
Then suffocate in painful tortures
On cutting tables of callous men
Under a knife of handsome butchers
Emeralds are ripped away
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.