Cross Average Price
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © danyprat

//@version=4
study(title="Cross Average Price", shorttitle="CAP", precision=6, overlay=true)
plot(sma(close, 14),"14",color=#ff9f1c)
plot(sma(close, 50),"50",color=#ffffff)
plot(sma(close, 100),"100",color=#2ec4b6)
plot(sma(close, 200),"200",color=#ff0000)
valore14 = sma(close, 14)
valore50 = sma(close, 50)
valore100 = sma(close, 100)
valore200 = sma(close, 200) 
s1 = iff(cross(valore14, valore50), avg(valore14,valore50), na)
plot(s1, style=plot.style_circles, linewidth=4, color=color.green)
s2 = iff(cross(valore14, valore100), avg(valore14,valore100), na)
plot(s2, style=plot.style_circles, linewidth=4, color=color.yellow)
s3 = iff(cross(valore14, valore200), avg(valore14,valore200), na)
plot(s3, style=plot.style_circles, linewidth=4, color=color.red)
