script("MA 20/50", kind="indicator") input length = 20 input length2 = 40 ma = ta.sma(close, length) ma2 = ta.sma(close, length2) crossUp = ta.crossover(ma, ma2) crossDown = ta.crossunder(ma, ma2) plot(ma, title="MA 20", color="#FF0000", width=6) plot(ma2, title="MA 50", color="#e29625ff", width=2) plotText(ma, when=crossUp, text="Cross up: {price}", color="#FF0000", position="below") plotText(ma2, when=crossDown, text="Cross down: {price}", color="#af4c99ff", position="above")