OPEN-SOURCE SCRIPT

Intersection Point

5 228
This publication focusses at the intersection of 2 lines, and a trend estimation derived from a comparison of Intersection Point value against current price value.

スナップショット

The formula to calculate the Intersection Point (IP) is:

Pine Script®
change1 = ta.change (valueLine1) change2 = ta.change (valueLine2) sf = (valueLine2[1] - valueLine1[1]) / (change1 - change2) I = valueLine1[1] + change1 * sf



🔶 USAGE

🔹 Future / Past Intersection

The position where 2 lines would intersect in the future is shown here by extending both lines and a yellow small line to indicate its location:
スナップショット

スナップショット
Of course this can change easily when price changes.

If "Back" is enabled, the IP in history can be seen:
スナップショット

The yellow line which indicates the IP is only visible when it is not further located then +/- 500 bars from current bar.
If this point is further away, lines towards the IP still will be visible (max 500 bars further) without the IP.
スナップショット
スナップショット


🔹 Trend

The calculated intersection price is compared with the latest close and used for estimating the trend direction.

スナップショット

スナップショット

When close is above the intersection price (I), this is an indication the market is trending up, if close is below I, this would indicate the market is trending down.

The included bands can be useful for entry/SL/TP,...

スナップショット


🔶 DETAILS

🔹 Map.new()

All values are put in a map.new() with the function value()
The latest Intersection is also placed in this map with the function addLastIntersectValue() and retrieved at the last bar (right top)


🔹 Intersection Point Line

The intersection price can be made visible by enabling "Intersection Price" in SETTINGS -> STYLE. To ensure lines aren't drawn all over the place, this value is limited to maximum high + 200 days-ATR and minimum low - 200 days-ATR.
スナップショット

🔶 SETTINGS

🔹 Choose the value for both lines:

Type: choose between
• open, high, low, close,
• SMA, EMA, HullMA, WMA, VWMA, DEMA, TEMA
   • The Length setting sets 1 of these Moving Averages when chosen
• src 1 -> You can pick an external source here

🔹 Length Intersection Line: Max length of line:
Intersection Line will update untillthe amount of bars reach the "Length Intersection Line"
スナップショット

💜 PURPLE BARS 😈

• Since TradingView has chosen to give away our precious Purple coloured Wizard Badge, bars are coloured purple 😊😉

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。