# II. Tạo cơ sở dữ liệu trên Amibroker

## 1. Tạo Database (DNSE Plug-in)

* Để sử dụng dữ liệu và các tiện ích cung cấp bởi Ami X trong AmiBroker bạn cần cài plugin.
* Tạo cơ sở dữ liệu (Database) trong AmiBroker theo các bước:

&#x20;1\)    Mở AmiBroker, vào menu File, chọn New > Database

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

2\)    Chọn thư mục lưu trữ cơ sở dữ liệu (Database folder)

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

3\)    Chọn DNSE data Plug-in trong mục Data source. Ở mục “Number of bars” điền 500.000

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

4\)    Ấn Configure và chọn đúng Thư mục dữ liệu: thường là C:\dnsedata (Lưu ý ko chọn vào C:\dnsedata\intraday)

<figure><img src="/files/464nsZ2G23y4EFb7Naxd" alt=""><figcaption></figcaption></figure>

5\)    Chọn loại data phù hợp nhu cầu (Nếu để chạy Bot Phái sinh thì chỉ chọn data Derivative)

<figure><img src="/files/5tjnx7D05bYqoXZu6pil" alt=""><figcaption></figcaption></figure>

## 2. Lưu ý về các loại data

Ami X cung cấp 3 loại dữ liệu:

* Giá theo ngày (EOD)
  * Độ dài không giới hạn
  * Dùng để xem khung Daily trở lên
* Giá theo tick (Intraday)
  * Độ dài: khoảng 1 tuần
  * Dạng data Tick
* Giá theo 1m (Intraday)
  * Độ dài: khoảng 10 tháng
  * Dùng để xem khung 1 phút trở lên

*Bạn có thể cài các database riêng cho từng loại dữ liệu*

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

## 3. Xem dữ liệu

Dữ liệu sẽ tự động tạo danh sách mã bao gồm:

* Chỉ số (Index)
* Phái sinh (Derivatives)
* Cổ phiếu (Stocks)

Bạn có thể xem danh sách các mã ở phía bên trái màn hình tại mục Symbols

Data sẽ bao gồm data quá khứ và realtime

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


---

# 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://hdsd.dnse.com.vn/san-pham-dich-vu/ami-x/ii.-tao-co-so-du-lieu-tren-amibroker.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.
