> For the complete documentation index, see [llms.txt](https://docs.fiinquant.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fiinquant.vn/ham-va-cong-thuc/5.-dinh-luong-and-phan-tich-nang-cao/5.3.-tuong-quan-and-so-sanh/5.3.3.-similarchart.md).

# 5.3.3. SimilarChart

{% hint style="info" %}
Cho phép người dùng tìm kiếm nhanh trong số lượng lớn mã cổ phiếu 5 mã có xu hướng giá gần nhất với mã cổ phiếu đang quan tâm.&#x20;
{% endhint %}

<figure><img src="/files/uEPJD4gIaet3gF3FR5Ua" alt=""><figcaption><p>5 mã cổ phiếu có xu hướng gần nhất với mã ACB hiện tại </p></figcaption></figure>

```python
client.SimilarChart().plot(Ticker=Ticker, t1=t1, t2=t2)
```

**Tham số**

| Tên tham số | Mô tả                          | Kiểu dữ liệu | Giá trị mặc định |
| ----------- | ------------------------------ | ------------ | ---------------- |
| Ticker      | Mã cổ phiếu áp dụng            | Ticker       | Không có         |
| t1          | Thời điểm bắt đầu của cụm nến  | str          |                  |
| t2          | Thời điểm kết thúc của cụm nến | str          |                  |

```python
import pandas as pd
from FiinQuantX import FiinSession
import datetime
from datetime import datetime
from dateutil.relativedelta import relativedelta

username = 'REPLACE_WITH_YOUR_USER_NAME'
password = 'REPLACE_WITH_YOUR_PASS_WORD'

client = FiinSession(
    username=username,
    password=password
).login()

def user_input():
    default_t1 = (datetime.now() - relativedelta(months=1)).strftime("%Y-%m-%d")
    default_t2 = datetime.now().strftime("%Y-%m-%d")
    print("")
    print("Chào mừng đến hệ thống dự báo biểu đồ CHỨNG KHOÁN theo THỜI GIAN THỰC của FIINQUANT")
    print("")
    print("Giải thích cách tìm chart có đường giá tương đồng với đường giá thời điểm hiện tại:")
    print("")
    print("- Tìm kiếm tất cả các pattern nến của tất cả các ngày trong vòng x năm kể từ thời điểm hiện tại")
    print("- Tìm ngày có đường giá giống với ngày hiện tại nhất")
    print("")
    print("Hệ thống sẽ sử dụng các tham số mặc định sau:")
    print(f'- Thời điểm bắt đầu: {default_t1}')
    print(f'- Thời điểm kết thúc (là thời điểm hiện tại): {default_t2}')

    use_default = input("Bạn có muốn sử dụng các tham số mặc định không? (y/n): ").lower() == "y"

    if not use_default:
        t1 = input("Nhập ngày bắt đầu (ví dụ: 2024-05-10): ")
        t2 = input("Nhập thời điểm kết thúc (ví dụ: 2024-05-10): ")
    else:
        t1 = default_t1
        t2 = default_t2
    
    Ticker = input("Vui lòng nhập mã bạn muốn so tìm đường tương quan (ví dụ: VN30, VN30F1M, ACB): ")
    Ticker = Ticker.upper()    
    print("Đang tính toán, vui lòng đợi")
    client.SimilarChart().plot(Ticker=Ticker, t1=t1, t2=t2)

if __name__ == "__main__":
    user_input()
```

<figure><img src="/files/D40ftwvutD1ikWK8RusZ" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.fiinquant.vn/ham-va-cong-thuc/5.-dinh-luong-and-phan-tich-nang-cao/5.3.-tuong-quan-and-so-sanh/5.3.3.-similarchart.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
