This script emulate's the built in linbreak function's functionality. However, I added multiple sources to my script. With the built in function no matter what you pass as the argument for the source it will take close data. List of sources available are below:
close
open
high
low
ohlc4
(high+low)/2
(open+close)/2
(high+low+close)/3
Number of Lines parameter is configurable from 2 to 6.
I contacted the originator (a.tesla2018) about helping me with coding the different source options for line break. He was very friendly, worked fast and efficiently, and delivered exactly what he promised. On top of all that, the script works beautifully, and does exactly what it is supposed to. High recommendations from me.