text: == 1:            sell_price = new_df['close'][i]            if sell_price <= buy_price * (1 - stop_loss):                new_df['pnl'][i] = -stop_loss            elif sell_price >= buy_price * (1 + profit_target):                new_df['pnl'][i] = profit_target            else:                new_df['pnl'][i] = (sell_price - buy_price) / buy_price        # Calculate the total profit or loss for all trades    total_pnl = new_df['pnl'].sum()        # Visualize the stock data, short-term moving average, and long-term moving average using a line chart    plt.figure(figsize=(12,6))    plt.plot(new_df.index, new_df['close'], label='Close')    plt.plot(new_df.index, new_df['short_ma'], label='Short MA')    plt.plot(new_df.index, new_df['long_ma'], label='Long MA')    plt.xlabel('Date')    plt.ylabel('Price')    plt.title('Stock Data with Moving Averages')    plt.legend()    plt.show()        # Visualize the buy and sell signals using a scatter plot    buy_signals = new_df[new_df['signal'] == 1]    sell_signals = new_df[new_df['signal'] == -1]