OPEN-SOURCE SCRIPT

Divergences (Pivots)

Cập nhật
I created the divergence indicator using pivot points.

Leftbars and Rightbars of Pivots are the same here and taken together as "Div Period", default set as 2 (= "Short" period).
The second period ("Long") multiplies this by 2, if a period of 2 is set, the "Long" period will be 4.
The third period ("Long2") multiplies the "Long" by 2, in this case the "Long2" period would be 8.

In these periods the high and lows of "source" (default = "close", can be changed though) and "RSI" are captured and compared.
The default "RSI length" of "14" can be changed as well.

"Short", "Long" and "Long2" periods can be made visible together or separately (Settings > Inputs).

I recommend to use a "Period" of "1" when using "W" charts, "1 or 2" on "D" charts, and "2 or 3" (maybe higher) when using lower timeframes.

Bullish divergences are "Green", Bearish divergences are "Red", Hidden divergences (Bullish and Bearish) are "White".

"Short" > "▲▼" (Bullish = Up, Bearish = Down)
"Long" > "∆∇" (Bullish = Up, Bearish = Down)
"Long2" > "⇧⇩" (Bullish = Up, Bearish = Down)

The "Values" of "HH"(Higher High), "LL" (Lower Low"), "HL"(Higher Low) & "LH"(Lower High) can be made visible (Settings > Inputs).
ảnh chụp nhanh

Thank you!


ảnh chụp nhanh
Phát hành các Ghi chú
This is an updated 'divergence indicator using pivot points'
(initially this version was called "'Divergences ( Pivots ) 2")

Instead of needing to change the 'periods' while changing the timeframe, here there are 4 'Periods' where the "high" and "lows" of
the "source" (default = "close", can be changed though) and "RSI" are captured and compared.

ảnh chụp nhanh

Each of the 4 'Periods' ('Very Short' - 'VS', 'Short' - 'S', 'Long' - 'L', 'Very Long' - 'VL') can be separately enabled/disabled/changed.

I like the settings:

"RSI"(20), "Periods": '2' - '4' - '8' - '16'

but it can be different of course, like:

"RSI"(9), "Periods": '1' - '2' - '3' - '4' (this setting was not possible with my first 'Divergences ( Pivots )' indicator)

or other settings for your liking!

The "Values" of "HH"(Higher High), "LL" (Lower Low"), "HL"(Higher Low) & "LH"(Lower High) can be made visible (Settings > Inputs).

ảnh chụp nhanh

Bullish divergences are "Green"
- 'Very Short' - 'VS', 'Short' - 'S' "period" > "▲"
- 'Long' - 'L', 'Very Long' - 'VL' "period" > "⇧"

Bearish divergences are "Red"
- 'Very Short' - 'VS', 'Short' - 'S' "period" > "▼"
- 'Long' - 'L', 'Very Long' - 'VL' "period" > "⇩"

Hidden divergences ( Bullish and Bearish ) are:
- 'Very Short' - 'VS', 'Short' - 'S' "period" > "▲▼" - "White"
- 'Long' - 'L', 'Very Long' - 'VL' "period" > "⬆︎⬇︎" - "Yellow"
Phát hành các Ghi chú
Hi, made some changes for the better :-)

- RSI is now default 14

More setting options for Divergences:
- 'Long Period', default checks 25 bars to the Left (="History") and 1 bar to the Right (="Future")
- 'Medium Period', default checks 15 bars to the Left (="History") and 1 bar to the Right (="Future")
- 'Short Period', default checks 5 bars to the Left (="History") and 1 bar to the Right (="Future")

Each Bar checks an amount of Bars at the Left (="History") and Bars to the Right (="Future"), insuring this particular Bar is the Highest or Lowest of them all at "close",
this is compared to the or or and so we have our Divergences.
There is always a slight delay (number of Bar(s) at the Right side (="Future")

> You can now alter both sides in a way that suits you best

If you like a setting, where the amount of “RightBars” equals the ”LeftBars” you can enable the " > Only change 'LeftBars'" button.
Then you only have to adjust the amount of “LeftBars” and the amount of “RightBars” automatically will be the same.

- Sensitivity Divergences, default x = '5'
x ⩾ 2 compares the value with ⩾ 2 previous values instead of 1, making the sensitivity higher

Bullish divergences are "Green":
- "⇡︎" = 'Short' "period"
- "↑︎" = 'Medium' "period"
- "⇧" = 'Long' "period"

Bearish divergences are "Red"
- "⇣︎" = 'Short' "period"
- "↓︎" = 'Medium' "period"
- "⇩︎" = 'Long' "period"

Hidden Bullish divergences are "White":
- "⇡︎" = 'Short' "period"
- "↑︎" = 'Medium' "period"
- "⇧" = 'Long' "period"

Hidden Bearish divergences are "White"
- "⇣︎" = 'Short' "period"
- "↓︎" = 'Medium' "period"
- "⇩︎" = 'Long' "period"

While evaluating be sure to check other time frames as well!

Thank you very much!
Phát hành các Ghi chú
Updated Alerts, also included a General Bull and Bear Alert
Phát hành các Ghi chú
Added extra alerts
Pivot PointsRelative Strength Index (RSI)

Mã nguồn mở

Theo tinh thần TradingView thực sự, tác giả của tập lệnh này đã xuất bản dưới dạng nguồn mở để các nhà giao dịch có thể hiểu và xác minh. Chúc mừng tác giả! Bạn có thể sử dụng miễn phí. Tuy nhiên, bạn cần sử dụng lại mã này theo Quy tắc nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?


PineCoder: pinecoders.com

- We cannot control our emotions,
but we can control our keyboard -

Thông báo miễn trừ trách nhiệm