OPEN-SOURCE SCRIPT
Atualizado Dynamic SMA

This script uses dynamic length to create a different sma type.
The length of the "Dynamic SMA" - "dSMA" can be:
'RSI', 'Stoch', 'ATR', 'MFI' or '%R'
For example 'RSI' -> the length of the sSMA will be the RSI itself
The biggest challenge was:
'Pine cannot determine the referencing length of a series. Try using max_bars_back' error
The writer of 'referencing length of a series' issue gave following solution:
bar_index == 0 ? 4999 : len
or in case of values which don't go above 100:
bar_index == 0 ? 100 : len
This assigns the necessary buffer to the function.
I'm most grateful for the given solution!
These dSMA's can give Support/Resistance levels, also crossovers of different dSMA's can give extra information
Examples:
RSI

ATR (close / atr(len)

Stoch

MFI

%R

"show regular SMA" will show the "SMA" with the same length (with default lighter color)
The length of the "Dynamic SMA" - "dSMA" can be:
'RSI', 'Stoch', 'ATR', 'MFI' or '%R'
For example 'RSI' -> the length of the sSMA will be the RSI itself
The biggest challenge was:
'Pine cannot determine the referencing length of a series. Try using max_bars_back' error
The writer of 'referencing length of a series' issue gave following solution:
bar_index == 0 ? 4999 : len
or in case of values which don't go above 100:
bar_index == 0 ? 100 : len
This assigns the necessary buffer to the function.
I'm most grateful for the given solution!
These dSMA's can give Support/Resistance levels, also crossovers of different dSMA's can give extra information
Examples:
RSI
ATR (close / atr(len)
Stoch
MFI
%R
"show regular SMA" will show the "SMA" with the same length (with default lighter color)
Notas de Lançamento
Updated to v5Due to evolution in Pine Script™, an error occurred,
should be fixed now.
Notas de Lançamento
Update, bugfix (max len 5000 allowed)Notas de Lançamento
Further Bugfix, sorry guys!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.
Who are PineCoders?
tradingview.com/chart/SSP/yW5eOqtm-Who-are-PineCoders/
TG Pine Script® Q&A: t.me/PineCodersQA
- We cannot control our emotions,
but we can control our keyboard -
tradingview.com/chart/SSP/yW5eOqtm-Who-are-PineCoders/
TG Pine Script® Q&A: t.me/PineCodersQA
- We cannot control our emotions,
but we can control our keyboard -
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.
Who are PineCoders?
tradingview.com/chart/SSP/yW5eOqtm-Who-are-PineCoders/
TG Pine Script® Q&A: t.me/PineCodersQA
- We cannot control our emotions,
but we can control our keyboard -
tradingview.com/chart/SSP/yW5eOqtm-Who-are-PineCoders/
TG Pine Script® Q&A: t.me/PineCodersQA
- We cannot control our emotions,
but we can control our keyboard -
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.