# 3.4. Lấy dữ liệu định giá P/E, P/B theo nhóm Ngành

Mô tả cách sử dụng thư viện sau khi người dùng đã đăng nhập. Các ví dụ chi tiết được nêu ra ở cuối chương này.

```python
data = client.MarketDepth().get_sector_valuation(
    tickers=tickers,
    level=level,
    from_date=from_date,
    to_date=to_date
)
```

**Tham số:**

| Tên tham số | Mô tả                                                                                                                                          | Kiểu dữ liệu  | Mặc định       | Bắt buộc |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------------- | -------- |
| tickers     | Danh sách nhóm ngành (tham khảo tại [11.2. Danh sách nhóm ngành ICB](/ham-va-cong-thuc/11.-du-lieu-ho-tro/11.2.-danh-sach-nhom-nganh-icb.md)). | str hoặc list |                | Có       |
| level       | Cấp độ nhóm ngành                                                                                                                              | int           |                | Có       |
| from\_date  | Mốc thời gian lấy dữ liệu xa nhất.                                                                                                             | str           |                | Có       |
| to\_date    | Mốc thời gian lấy dữ liệu gần nhất.                                                                                                            | str           | datetime.now() | Không    |

Class nhận dữ liệu là MarketDepth và có phương thức nhận dữ liệu là get\_stock\_valuation()

```python
data = client.MarketDepth().get_sector_valuation(
    tickers=["Banks","Insurance"],
    level=2,
    from_date="2025-08-28",
    to_date="2025-09-03"
)
print(data)
```

Dữ liệu có các thuộc tính:

| Tên thuộc tính | Mô tả               | Kiểu dữ liệu |
| -------------- | ------------------- | ------------ |
| ticker         | Tên nhóm ngành.     | str          |
| timestamp      | Thời gian giao dịch | str          |
| pe             | Chỉ số P/E          | float        |
| pb             | Chỉ số P/B          | float        |


---

# 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://docs.fiinquant.vn/ham-va-cong-thuc/3.-phan-tich-co-ban-and-dinh-gia/3.4.-lay-du-lieu-dinh-gia-p-e-p-b-theo-nhom-nganh.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.
