This is a trading bot and this is the following code. It doesn't work, fix it 

import backtrader as bt
import pandas as pd
import yfinance as yf
import requests

token = ""
chat_id = ""

def send_message(text):
    url = f"https://api.telegram.org/bot{token}/sendMessage"
    params = {
        "chat_id": chat_id,
        "text": text,
    }
    resp = requests.get(url, params=params)
    resp.raise_for_status()

class MovingAverageStrategy(bt.Strategy):
    params = (("fast_ma", 20), ("slow_ma", 50))

    def init(self):
        self.fast_ma = bt.indicators.SMA(self.data, period=self.params.fast_ma)
        self.slow_ma = bt.indicators.SMA(self.data, period=self.params.slow_ma)
        self.crossover = bt.indicators.CrossOver(self.fast_ma, self.slow_ma)

    def next(self):
        if not self.position:
            if self.crossover > 0:
                self.buy()
        elif self.crossover < 0:
            self.sell()

class MomentumStrategy(bt.Strategy):
    params = (("period", 14), ("mom", 10))

    def init(self):
        self.mom = bt.indicators.Momentum(self.data, period=self.params.period)

    def next(self):
        if not self.position:
            if self.mom > self.params.mom:
                self.buy()
        elif self.mom < self.params.mom:
            self.sell()

class ZScore(bt.Indicator):
    lines = ("zscore",)
    params = (("period", 20),)

    def init(self):
        self.bband = bt.indicators.BollingerBands(self.data, period=self.params.period)
        self.stddev = bt.indicators.StandardDeviation(self.data, period=self.params.period)

    def next(self):
        self.lines.zscore[0] = (self.data[0] - self.bband.lines.mid[0]) / self.stddev[0]

class MeanReversionStrategy(bt.Strategy):
    params = (("period", 20),)

    def init(self):
        self.zscore = ZScore(period=self.params.period)

    def next(self):
        if not self.position:
            if self.zscore < -1.0:
                self.buy()
        elif self.zscore > 1.0:
            self.sell()

class TrendFollowingStrategy(bt.Strategy):
    params = (("fast_ma_period", 50), ("slow_ma_period", 200),)

    def init(self):
        self.fast_ma = bt.indicators.SimpleMovingAverage(self.data, period=self.params.fast_ma_period)
        self.slow_ma = bt.indicators.SimpleMovingAverage(self.data, period=self.params.slow_ma_period)

    def next(self):
        if not self.position:
            if self.fast_ma > self.slow_ma:
                self.buy()
        elif self.fast_ma < self.slow_ma:
            self.sell()

stock_list = ["MSFT", "AAPL", "GOOGL", "TSLA"]
strategy_list = [MovingAverageStrategy, MomentumStrategy, MeanReversionStrategy, TrendFollowingStrategy]

for stock in stock_list:
    try:
        data = yf.download(stock, start="2010-01-01", end="2023-03-28", auto_adjust=True, ignore_tz=True)

        if data.empty:
            raise ValueError(f"No data found for {stock} in the specified date range.")

        data = bt.feeds.PandasData(dataname=data)

        for strat in strategy_list:
            cerebro = bt.Cerebro()

            cerebro.adddata(data)
            cerebro.addstrategy(strat)
            cerebro.broker.setcash(10000)
            cerebro.broker.setcommission(commission=0.001)
            cerebro.addsizer(bt.sizers.PercentSizer, percents=10)
            cerebro.addsizer(bt.sizers.PercentSizer, percents=10)


            starting_value = cerebro.broker.getvalue()
            result = cerebro.run()
            final_value = cerebro.broker.getvalue()

            message = f"Stock: {stock}\n"
            message += f"Strategy: {strat.name}\n"
            message += f"Starting Portfolio Value: {starting_value:.2f}\n"
            message += f"Final Portfolio Value: {final_value:.2f}\n"
            gain = final_value - starting_value
            message += f"Total Gain: {gain:.2f}\n"
            message += f"ROI : {gain / starting_value * 100:.2f}%\n"
            send_message(message)

    except ValueError as e:
        print(e)
        continue