class_docstr: StockPortfolio is the main class of `pyrtfolio` which is going to manage all the introduced stocks.
  
  This class is the one that contains the stocks information and the one that will be used by the user in order to
  generate a custom portfolio. So on, this function implements the methods to calculate all the values required in a
  basic portfolio and, as already mentioned, the method to add stocks.
  
  Attributes:
      stocks (:obj:`list`, protected):
          this list contains all the introduced stocks, which will later be used to generate the portfolio.
      stock_objs (:obj:`list`, protected):
          this list contains all the introduced Stock objects, in order to be able to refresh them.
      data (:obj:`pandas.DataFrame`): it is the generated portfolio, once the addition of every stock is validated.
class_docstr_tok: ["StockPortfolio","is","the","main","class","of","`","pyrtfolio","`","which","is","going","to","manage","all","the","introduced","stocks",".","This","class","is","the","one","that","contains","the","stocks","information","and","the","one","that","will","be","used","by","the","user","in","order","to","generate","a","custom","portfolio",".","So","on",",","this","function","implements","the","methods","to","calculate","all","the","values","required","in","a","basic","portfolio","and",",","as","already","mentioned",",","the","method","to","add","stocks",".","Attributes",":","stocks","(",":","obj",":","`","list","`",",","protected",")",":","this","list","contains","all","the","introduced","stocks",",","which","will","later","be","used","to","generate","the","portfolio",".","stock_objs","(",":","obj",":","`","list","`",",","protected",")",":","this","list","contains","all","the","introduced","Stock","objects",",","in","order","to","be","able","to","refresh","them",".","data","(",":","obj",":","`","pandas.DataFrame","`",")",":","it","is","the","generated","portfolio",",","once","the","addition","of","every","stock","is","validated","."]
docstr: Method to add a stock to the portfolio.
  
  This method adds a stock to the custom portfolio data. Some parameters need to be specified for the introduced
  stock such as the purchase date of the shares, the number of shares bought and the price payed (cost) per every
  share. From this data, the portfolio will be created and the specified calculations will be done, so to give
  the user an overview of his/her own portfolio.
  
  Args:
      stock_symbol (:obj:`str`): symbol of the Stock that is going to be added to the StockPortfolio.
      stock_country (:obj:`str`): country from where the specified stock_symbol is, so to validate it.
      purchase_date (:obj:`str`):
          date when the shares of the introduced stock were bought, formatted as dd/mm/yyyy.
      num_of_shares (:obj:`int`): amount of shares bought of the specified Stock in the specified date.
      cost_per_share (:obj:`float`): price of every share of the Stock in the specified date.
docstr_tok: ["Method","to","add","a","stock","to","the","portfolio",".","This","method","adds","a","stock","to","the","custom","portfolio","data",".","Some","parameters","need","to","be","specified","for","the","introduced","stock","such","as","the","purchase","date","of","the","shares",",","the","number","of","shares","bought","and","the","price","payed","(","cost",")","per","every","share",".","From","this","data",",","the","portfolio","will","be","created","and","the","specified","calculations","will","be","done",",","so","to","give","the","user","an","overview","of","his\/her","own","portfolio",".","Args",":","stock_symbol","(",":","obj",":","`","str","`",")",":","symbol","of","the","Stock","that","is","going","to","be","added","to","the","StockPortfolio",".","stock_country","(",":","obj",":","`","str","`",")",":","country","from","where","the","specified","stock_symbol","is",",","so","to","validate","it",".","purchase_date","(",":","obj",":","`","str","`",")",":","date","when","the","shares","of","the","introduced","stock","were","bought",",","formatted","as","dd\/mm\/yyyy",".","num_of_shares","(",":","obj",":","`","int","`",")",":","amount","of","shares","bought","of","the","specified","Stock","in","the","specified","date",".","cost_per_share","(",":","obj",":","`","float","`",")",":","price","of","every","share","of","the","Stock","in","the","specified","date","."]
code: def add_stock(
      self,
      stock_symbol,
      stock_country,
      purchase_date,
      num_of_shares,
      cost_per_share,
  ):
      """Method to add a stock to the portfolio.
  
      This method adds a stock to the custom portfolio data. Some parameters need to be specified for the introduced
      stock such as the purchase date of the shares, the number of shares bought and the price payed (cost) per every
      share. From this data, the portfolio will be created and the specified calculations will be done, so to give
      the user an overview of his/her own portfolio.
  
      Args:
          stock_symbol (:obj:`str`): symbol of the Stock that is going to be added to the StockPortfolio.
          stock_country (:obj:`str`): country from where the specified stock_symbol is, so to validate it.
          purchase_date (:obj:`str`):
              date when the shares of the introduced stock were bought, formatted as dd/mm/yyyy.
          num_of_shares (:obj:`int`): amount of shares bought of the specified Stock in the specified date.
          cost_per_share (:obj:`float`): price of every share of the Stock in the specified date.
  
      """
      stock = Stock(
          stock_symbol,
          stock_country,
          purchase_date,
          num_of_shares,
          cost_per_share,
      )
      stock.validate()
  
      if stock.valid is True:
          self._stock_objs.append(stock)
  
          info = self.__get_stock_info(stock=stock)
  
          self._stocks.append(info)
          self.data = pd.DataFrame(self._stocks)
      else:
          raise ValueError(
              "ERROR [0001]: The introduced Stock is not valid."
          )
  
file_path: pyrtfolio/pyrtfolio/StockPortfolio.py
imports: from datetime import date
  import investpy
  import pandas
  from pyrtfolio.Stock import Stock
label_desc: Use image node_id 2 for calling the StockPortfolio obj's underlying member method code with example usage: obj.add_stock(stock_symbol, stock_country, purchase_date, num_of_shares, cost_per_share) without return types