JCFBaux Volatility [Loxx]
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © loxx

//@version=5
indicator("JCFBaux Volatility [Loxx]", 
     shorttitle = "JCFBV [Loxx]",
     timeframe="", 
     timeframe_gaps=true, 
     overlay = false)
     
greencolor = #2DD204

import loxx/loxxjuriktools/1 as jf

src = input.source(close, "Source", group = "Basic Settings")
depth = input.int(15, "Depth", group = "Basic Settings")
phase = input.float(0, "Signal - Juirk Smoothing Phase", group = "Basic Settings")
lensmdd = input.int(300, "Signal - Period", group = "Basic Settings")

colorbars = input.bool(true, "Color bars?", group = "UI Options")
showSigs = input.bool(true, "Show signals?", group= "UI Options")

jcfbaux = jf.jcfbaux(src, depth)

signal = jf.jurik_filt(jcfbaux, lensmdd, phase)

plot(signal, color = color.white)
plot(jcfbaux, color = jcfbaux >= signal ? greencolor : color.gray, linewidth = 2)
barcolor(colorbars ? jcfbaux >= signal ? greencolor : color.gray : na)

goVol = ta.crossover(jcfbaux, signal)

plotshape(showSigs and goVol, title = "Volatility Rising", color = color.yellow, textcolor = color.yellow, text = "V", style = shape.triangleup, location = location.bottom, size = size.auto)

alertcondition(goVol, title = "Volatility Rising", message = "JCFBaux Volatility [Loxx]: Long\nSymbol: {{ticker}}\nPrice: {{close}}")
