class_docstr: Provides methods for retrieving daily stock data from
  tushare API
  Attributes
  ----------
      start_date : str
          start date of the data (modified from config.py)
      end_date : str
          end date of the data (modified from config.py)
      ticker_list : list
          a list of stock tickers (modified from config.py)
  Methods
  -------
  fetch_data()
      Fetches data from tushare API
  date: date
  Open: opening price
  High: the highest price
  Close: closing price
  Low: lowest price
  Volume: volume
  Price_change: price change
  P_change: fluctuation
  ma5: 5-day average price
  Ma10: 10 average daily price
  Ma20:20 average daily price
  V_ma5:5 daily average
  V_ma10:10 daily average
  V_ma20:20 daily average
docstr: Fetches data from Alpaca
  Parameters
  ----------
  Returns
  -------
  `pd.DataFrame`
      7 columns: A date, open, high, low, close, volume and tick symbol
      for the specified stock ticker
docstr_tok: ["Fetches","data","from","Alpaca","Parameters","--","--","--","--","--","Returns","--","--","--","-","`","pd.DataFrame","`","7","columns",":","A","date",",","open",",","high",",","low",",","close",",","volume","and","tick","symbol","for","the","specified","stock","ticker"]
code: def fetch_data(self) -> pd.DataFrame:
      """Fetches data from Alpaca
      Parameters
      ----------
      Returns
      -------
      `pd.DataFrame`
          7 columns: A date, open, high, low, close, volume and tick symbol
          for the specified stock ticker
      """
      # Download and save the data in a pandas DataFrame:
      data_df = pd.DataFrame()
      for tic in tqdm(self.ticker_list, total=len(self.ticker_list)):
          temp_df = ts.get_hist_data(
              tic[0:6], start=self.start_date, end=self.end_date
          )
          temp_df["tic"] = tic[0:6]
          # data_df = data_df.append(temp_df)
          data_df = pd.concat(
              [data_df, temp_df], axis=0, ignore_index=True
          )
  
      data_df = data_df.reset_index(level="date")
  
      # create day of the week column (monday = 0)
      data_df = data_df.drop(
          [
              "price_change",
              "p_change",
              "ma5",
              "ma10",
              "ma20",
              "v_ma5",
              "v_ma10",
              "v_ma20",
          ],
          1,
      )
      data_df["day"] = pd.to_datetime(data_df["date"]).dt.dayofweek
      # rank desc
      data_df = data_df.sort_index(axis=0, ascending=False)
      # convert date to standard string format, easy to filter
      data_df["date"] = pd.to_datetime(data_df["date"])
      data_df["date"] = data_df.date.apply(
          lambda x: x.strftime("%Y-%m-%d")
      )
      # drop missing data
      data_df = data_df.dropna()
      data_df = data_df.reset_index(drop=True)
      print("Shape of DataFrame: ", data_df.shape)
      # print("Display DataFrame: ", data_df.head())
      print(data_df)
      data_df = data_df.sort_values(by=["date", "tic"]).reset_index(
          drop=True
      )
      return data_df
  
imports: from __future__ import annotations
  import pandas
  import tushare
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling the TushareDownloader obj's underlying member method code with example usage: obj.fetch_data() and returns: data_df