# ComputePortfolioReturns

### Function specification

```
ComputePortfolioReturns(entities, date_from, date_to, weight,
                rebalancing_freq="daily", rebalancing_date=0, transaction_cost=0)
```

### Parameters

| Parameter           | Type            | Description                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| entities            | list of strings | 종목명 리스                                                                                                                                                                                                                                                                                                                                                                                                        |
| date\_from/date\_to | date            | 수익률 계산 기간                                                                                                                                                                                                                                                                                                                                                                                                     |
| weight              | string          | 비중 결정 방식 ( "equal", "value", "relevance" )                                                                                                                                                                                                                                                                                                                                                                    |
| rebalancing\_freq   | string          | 리밸런싱 주기 ( "daily","monthly", "quarterly", "semi-annual", "annual", "no" )                                                                                                                                                                                                                                                                                                                                     |
| rebalancing\_date   | int             | the i-th date of portfolio rebalancing within the given frequency. For example, if (quarterly, 2) is given, it means the portfolio is to be rebalanced at the end of 2nd month in a quarter, e.g., Feb 28, May 31, Aug 31, and Nov 30. Similarly, if (monthly, 25) is given, the portfolio will be rebalaned at the 25th of every month. The default value is zero, which indicates the last date of a cycle. |
| transaction\_cost   | float           | 거래 비용 (%) ex) 1.0 -> 1.0%                                                                                                                                                                                                                                                                                                                                                                                     |

### Result

{% content-ref url="../../../result\_layout/result-portfolioreturns" %}
[result-portfolioreturns](https://help.deepsearch.com/dp/api/result_layout/result-portfolioreturns)
{% endcontent-ref %}

### Examples

```
> ComputePortfolioReturns([삼성전자, LG전자, 네이버], 2013-01-01, 2018-12-31, "equal")
> ComputePortfolioReturns(상위(인공지능 관련 기업,10), 2013-01-01, 2018-12-31, "equal")
> ComputePortfolioReturns(시가총액 > 1000000000000, 2013-01-01, 2018-12-31, "equal")
> ComputePortfolioReturns([삼성전자, LG전자, 네이버], 2013-01-01, 2018-12-31, "equal", "daily")
> ComputePortfolioReturns([삼성전자, LG전자, 네이버], 2013-01-01, 2018-12-31, "equal", "no")
> ComputePortfolioReturns([삼성전자, LG전자, 네이버], 2013-01-01, 2018-12-31, "equal", "monthly")
```

###
