Price levels

440 vizualizações
Thanks to the developers for adding arrays to TradingView. This gives you more freedom in Pine Script coding.

I have created an algorithm that draws support and resistance levels on a chart. The algorithm can be easily customized as you need.

This algorithm can help both intuitive and system traders. Intuitive traders just look at the drawn lines. For system traders, the "levels" array stores all level values. Thus, you can use these values ​​for algorithmic trading.
Notas de Lançamento: Now you can set the number of historical bars to search for a level. This will avoid getting random levels. Also, you can set a limit on the number of lines on the chart. The old levels will be deleted and will not bother you.

It should be noted that this algorithm is difficult to use on small timeframes due to the limited capabilities of the Pine Script. We can reference a maximum of 5000 historical bars in cycles. Also, the script may receive an error due to a long calculation. Therefore, do not ask too much of the algorithm on small timeframes.
Notas de Lançamento: Now you can graphically customize your indicator.
Notas de Lançamento: Fixed a small bug in the variable title.
Notas de Lançamento: made the code look nice!
Notas de Lançamento: made the code look nice!
Remover dos scripts favoritos Adicionar aos scripts favoritos


excellent script for array application! thanks for sharing !
+1 Resposta
kitoboynaya blackcat1402
@blackcat1402, Thank. It's good that arrays were added in Pine Script!
Thanks for this script @kitoboynaya. Question: what does it mean when no line appear in a (stock) chart ? How to better adjust its sensitivity? Cheers
@MasBart, You are welcome. Read the comments above the variables. I commented everything. And see how it works on a monthly timeframe, where there are few candles and it's easy to figure it out.
Looks slick dude
Início Rastreador de Fundamentos Rastreador Forex Rastreador de Criptomoedas Calendário Econômico Como Funciona Recursos gráficos Preços Indique um Amigo Regras da Casa Central de Ajuda Soluções para Sites & Corretoras Widgets Soluções em Gráficos Biblioteca de Gráficos Lightweight Blog & Notícias Twitter
Perfil Configurações de perfil Conta e Cobrança Amigos indicados Moedas Meus Tíquetes de Suporte Central de Ajuda Ideias Publicadas Seguidores Seguindo Mensagens Privadas Conversa Deslogar