# 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="/pages/-MX0u3YRe2FnOzWXDDvW" %}
[Result:PortfolioReturns](/dp/api/result_layout/result-portfolioreturns.md)
{% 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")
```

###


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.deepsearch.com/dp/api/func/event/portfolio/computeportfolioreturns.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
