TradingView
DevLucem
Dec 18, 2021 4:34 PM

Divergence 

Netherlands 25OANDA

描述

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.
tradingview.com/script/FCUgF8ag-Plain-Stochastic-Divergence/
评论
Trendoscope
Thanks for the library. Well done.
DevLucem
@HeWhoMustNotBeNamed, Thank you ♥
Hutmacher42
interesting way to calculate the fractals. Nice One!!!
DevLucem
@Hutmacher42, Interesting to know someone saw that 😅
burgercrisis
great script and can I just say... that chart looks like an altcoin wow
miwawoku
What is is script good for?
DevLucem
@miwawoku, This is a library for coders
Market-Masters
how to i make it connect the pivot highs/lows with a line when divergence is detected?
更多