input: Write a python function to generate trading signals based on short and long moving averages and plot the results.
  assert automated_strategy(pd.DataFrame({'Close': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}), 2, 5) is None
  assert automated_strategy(pd.DataFrame({'Close': [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]}), 3, 6) is None
  assert automated_strategy(pd.DataFrame({'Close': [5, 10, 15, 20, 25, 30, 35, 40, 45, 50]}), 1, 4) is None
output: import pandas as pd
  import matplotlib.pyplot as plt
  
  def automated_strategy(df, short_window, long_window):
      df['Short_MA'] = df['Close'].rolling(window=short_window, min_periods=1).mean()
      df['Long_MA'] = df['Close'].rolling(window=long_window, min_periods=1).mean()
  
      df['Signal'] = 0
      df['Signal'][short_window:] = np.where(df['Short_MA'][short_window:] > df['Long_MA'][short_window:], 1, 0)
      df['Position'] = df['Signal'].diff()
  
      plt.figure(figsize=(10, 5))
      plt.plot(df['Close'], label='Close Price')
      plt.plot(df['Short_MA'], label=f'Short MA ({short_window})')
      plt.plot(df['Long_MA'], label=f'Long MA ({long_window})')
      plt.plot(df[df['Position'] == 1].index, df['Short_MA'][df['Position'] == 1], '^', markersize=10, color='g', lw=0, label='Buy Signal')
      plt.plot(df[df['Position'] == -1].index, df['Short_MA'][df['Position'] == -1], 'v', markersize=10, color='r', lw=0, label='Sell Signal')
  
      plt.title('Stock Price and Moving Averages')
      plt.xlabel('Date')
      plt.ylabel('Price')
      plt.legend(loc='best')
      plt.show()