DevLucem

Divergence

Library "Divergence"
Calculates a divergence between 2 series

bullish(_src, _low, depth) Calculates bullish divergence
  Parameters:
    _src: Main series
    _low: Comparison series (`low` is used if no argument is supplied)
    depth: Fractal Depth (`2` is used if no argument is supplied)
  Returns: 2 boolean values for regular and hidden divergence

bearish(_src, _high, depth) Calculates bearish divergence
  Parameters:
    _src: Main series
    _high: Comparison series (`high` is used if no argument is supplied)
    depth: Fractal Depth (`2` is used if no argument is supplied)
  Returns: 2 boolean values for regular and hidden divergence

I created this library to plug and play divergences in any code.
You can create a divergence indicator from any series you like.
Fractals are used to pinpoint the edge of the series. The higher the depth, the slower the divergence updates get.

My Plain Stochastic Divergence uses the same calculation. Watch it in action.

🤖🤖🤖🤖🤖🤖🤖🤖🤖🤖
Automate TradingView Alerts
tradingview.to/anywhere
🥰😍😍🥰😍😍🥰😍😍🥰
Biblioteka Pine

Działając zgodnie z prawdziwym duchem TradingView, autor opublikował ten kod Pine jako bibliotekę o otwartym kodzie źródłowym, aby inni programiści Pine z naszej społeczności mogli go ponownie wykorzystać. Brawa dla niego! Możesz korzystać z tej biblioteki prywatnie lub w innych publikacjach typu open source, ale ponowne wykorzystanie tego kodu w publikacji podlega Regulaminowi.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz skorzystać z tej biblioteki?

Skopiuj poniższy wiersz i wklej go w swoim skrypcie.