Equal

Get underlying data

portfolio.po.equal(symbols: List[str], interval: str = ‘3y’, start_date: str = ‘’, end_date: str = ‘’, log_returns: bool = False, freq: str = ‘D’, maxnan: float = 0.05, threshold: float = 0, method: str = ‘time’, value: float = 1.0) -> Tuple

Equally weighted portfolio, where weight = 1/# of symbols

Parameters
----------
symbols : List[str]
    List of portfolio stocks
interval : str, optional
    interval to get stock data, by default "3mo"
start_date: str, optional
    If not using interval, start date string (YYYY-MM-DD)
end_date: str, optional
    If not using interval, end date string (YYYY-MM-DD). If empty use last
    weekday.
log_returns: bool, optional
    If True calculate log returns, else arithmetic returns. Default value
    is False
freq: str, optional
    The frequency used to calculate returns. Default value is 'D'. Possible
    values are:
        - 'D' for daily returns.
        - 'W' for weekly returns.
        - 'M' for monthly returns.

maxnan: float
    Max percentage of nan values accepted per asset to be included in
    returns.
threshold: float
    Value used to replace outliers that are higher to threshold.
method: str
    Method used to fill nan values. Default value is 'time'. For more information see
    `interpolate <https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.interpolate.html>`_.
value : float, optional
    Amount to allocate.  Returns percentages if set to 1.

Returns
-------
dict
    Dictionary of weights where keys are the tickers