OPEN-SOURCE SCRIPT

Auto Swing TP

Automatic TP generator from recent swing highs and swing lows

Multiple long & short TPs from current price are displayed.

Results will differ by timeframe.

The main parameter is the "cell size" which is the least significant price move for the current asset. The default value of 0.4% is optimized for crypto. You may want to use less for less volatile asset classes.

How it works

We divide price into cells of a certain percent sizes, mainly because this makes the computation a lot easier.

We note in which bar every price cell was last visited. We take the distance to the current bar and then the logarithm of that to a certain base (the "time dimension"). Using a logarithm gives a nice balance of near-term and long-term targets. We call that logarithmic value the "level" of that price cell.

If a price cell has a significantly higher or lower level (at least by +2 or -2) than the cell above or below, this is considered a possible TP area.

Finally we check if the trade makes sense (meaning is of a certain size, at least 10 cells by default). If yes, we reduce the TP by a bit (by default 2 cells) and add it to the chart.
Pivot Points

Skrip sumber terbuka

Dalam semangat sebenar TradingView, penulis telah menerbitkan kod Pine ini sebagai sumber terbuka supaya pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara percuma, tetapi penggunaan semula kod dalam penerbitan ini adalah dikawal oleh Peraturan dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Ingin menggunakan skrip ini pada carta?


Juga pada:

Penafian