# 8.8. Price Level Indicators (Chỉ báo biến động giá)

### 8.8.1. Fibonacci Retracement

Fibonacci Retracement là một công cụ phân tích kỹ thuật dùng để xác định các vùng giá có khả năng trở thành:

* Hỗ trợ (Support) trong xu hướng tăng
* Kháng cự (Resistance) trong xu hướng giảm

Chỉ báo dựa trên tỷ lệ vàng Fibonacci: 23.6%, 38.2%, 50.0%, 61.8%, 78.6%.

```python
def fib_retracement_uptrend(high: pd.Series, low: pd.Series) -> dict: ...
def fib_retracement_downtrend(high: pd.Series, low: pd.Series) -> dict: ...
```

**Tham số**

| Tên tham số | Mô tả                       | Kiểu dữ liệu | Giá trị mặc định |
| ----------- | --------------------------- | ------------ | ---------------- |
| high        | Swing High (đỉnh gần nhất). | float        |                  |
| low         | Swing Low (đáy gần nhất).   | float        |                  |

Ví dụ:

```python
fi = client.FiinIndicator()
fib_uptrend = fi.fib_retracement_uptrend(data["high"], data["low"])
fib_downtrend = fi.fib_retracement_downtrend(data["high"], data["low"])
print(fib_uptrend)
print(fib_downtrend)
```

Dữ liệu trả ra là dictionary chứa các cặp key - value sau:

* SwingHigh: Mức giá tương ứng điểm cao nhất
* SwingLow: Mức giá tương ứng điểm thấp nhất
* Các mức giá dựa trên tỷ lệ vàng Fibonacci: 23.6%, 38.2%, 50.0%, 61.8%, 78.6% (dùng hàm fib\_retracement\_uptrend sẽ là mức giá trên, fib\_retracement\_downtrend sẽ là mức giá dưới):
  * 0.236: Mức giá tương ứng tỷ lệ 23.6%
  * 0.382: Mức giá tương ứng tỷ lệ 38.2%
  * 0.500: Mức giá tương ứng tỷ lệ 50.0%
  * 0.618: Mức giá tương ứng tỷ lệ 61.8%
  * 0.786: Mức giá tương ứng tỷ lệ 78.6%


---

# 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/8.-danh-sach-chi-so-ta/8.8.-price-level-indicators-chi-bao-bien-dong-gia.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.
