TradingView
fikira
10 Th11 2019 00:02

Divergences (Pivots) 

Bitcoin / TetherUSBinance

Mô 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).


Thank you!


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.



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).



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
Bình luận
StanBx
is this repainting?
fikira
@StanBx,
Except for the most recent symbol (because the final close hasn't finished yet and this causes the symbol to (dis)appear until the final close),
I haven't experienced "repainting" yet,
hope this helps!
BitcoinCalls
@fikira,

Just want to say thank you for this. Just added to chart so haven't looked too closely, but it seems AWESOME, you did a really great job coding this!
fikira
@BitcoinCalls, Thank you so very much! Appreciate it!
babayaza
@StanBx, ran it on replay and it does unfortunately, but rarely. Such is the nature of divergence though, you just don't know where it ends. The alternative to repaint would be late signal (minimum 2-3 opposite candles). I prefer repaint over late signal. At least if the signal is early you can determine with your own eyes if it's safe to enter. Not much you can do if the alert goes off way too late.
babayaza
Brilliant work fikira.
askyland
Thank you Fikira very much , it is very good indicator , I hope if you can add alarm in it and also the arrows is very small if you can make it big , Thank you
fikira
@askyland, Thanks! Alerts are there ;)
Logancaptain
How to set this kind of indicator?
fikira
@mingkang1616, Just use it for detecting divergences, settings are explained above, hope this helps!
Thêm nữa