TradingView
kitoboynaya
17 de Sep. de 2020 4:48

Price levels 

Bitcoin / TetherUSBinance

Descripción

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 prensa

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 prensa

Now you can graphically customize your indicator.

Notas de prensa

Fixed a small bug in the variable title.

Notas de prensa

made the code look nice!

Notas de prensa

made the code look nice!
Comentarios
blackcat1402
excellent script for array application! thanks for sharing !
kitoboynaya
@blackcat1402, Thank. It's good that arrays were added in Pine Script!
MasBart
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
kitoboynaya
@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.
AltJams
Looks slick dude
Más