// Plot the moving averages on the chart plot(ma20, color=color.green, linewidth=2, title="MA 20") plot(ma50, color=color.blue, linewidth=2, title="MA 50") plot(ma200, color=color.red, linewidth=2, title="MA 200")
This function plots each of the moving averages on the chart. The color parameter sets the color for each SMA: MA 20 is plotted in green MA 50 is plotted in blue MA 200 is plotted in red