The script uses the ema function to calculate the EMAs based on the previous day's closing prices then uses the plot function to draw lines for each EMA. You can customize the colors and titles of each EMA by adjusting the parameters of the plot function.