1.4. Lấy dữ liệu vốn hóa
Mô tả cách sử dụng thư viện sau khi người dùng đã đăng nhập. Chi tiết được nêu ra ở cuối chương này.
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.
data = client.PriceStatistics().get_overview(
tickers=tickers,
time_filter=time_filter,
from_date=from_date,
to_date=to_date
).get_data()
Tham số:
tickers
Danh sách mã được viết in hoa.
str hoặc list
Có
time_filter
Tần suất lấy dữ liệu, có thể lấy dữ liệu theo Ngày, Tuần, Tháng, Quý, Năm. Truyền vào 1 trong 5 giá trị "Daily", "Weekly", "Monthly", "Quarterly", "Yearly".
str
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à PriceStatistics và có phương thức nhận dữ liệu là get_Overview()
data = client.PriceStatistics().get_overview(
tickers=tickers,
time_filter="Daily",
from_date="2025-08-20",
to_date="2025-08-27"
)
print(data)
Dữ liệu có các thuộc tính:
time_filter="Daily"
ticker
Tên mã.
str
timestamp
Thời gian giao dịch
str
percentPriceChange
% thay đổi giá đóng cửa so với giá tham chiếu
float
totalMatchVolume
Tổng khối lượng khớp lệnh
float
totalMatchValue
Tổng giá trị khớp lệnh
int
totalDealVolume
Tổng khối lượng thỏa thuận
float
totalDealValue
Tổng giá trị thỏa thuận
int
marketCap
Tổng giá trị vốn hóa
int
time_filter="Weekly"
ticker
Tên mã.
str
week
Tuần trong năm
int
year
Năm
int
totalMatchVolume
Tổng khối lượng khớp lệnh
float
totalMatchValue
Tổng giá trị khớp lệnh
int
totalDealVolume
Tổng khối lượng thỏa thuận
float
totalDealValue
Tổng giá trị thỏa thuận
int
percentPriceChange
% thay đổi giá đóng cửa 1W
float
marketCap
Tổng giá trị vốn hóa
int
time_filter="Monthly"
ticker
Tên mã.
str
month
Tháng trong năm
int
year
Năm
int
totalMatchVolume
Tổng khối lượng khớp lệnh
float
totalMatchValue
Tổng giá trị khớp lệnh
int
totalDealVolume
Tổng khối lượng thỏa thuận
float
totalDealValue
Tổng giá trị thỏa thuận
int
percentPriceChange
% thay đổi giá đóng cửa 1M
float
marketCap
Tổng giá trị vốn hóa
int
time_filter="Quarterly"
ticker
Tên mã.
str
quarter
Quý trong năm
int
year
Năm
int
totalMatchVolume
Tổng khối lượng khớp lệnh
float
totalMatchValue
Tổng giá trị khớp lệnh
int
totalDealVolume
Tổng khối lượng thỏa thuận
float
totalDealValue
Tổng giá trị thỏa thuận
int
percentPriceChange
% thay đổi giá đóng cửa 1Q
float
marketCap
Tổng giá trị vốn hóa
int
time_filter="Yearly"
ticker
Tên mã.
str
year
Năm
int
totalMatchVolume
Tổng khối lượng khớp lệnh
float
totalMatchValue
Tổng giá trị khớp lệnh
int
totalDealVolume
Tổng khối lượng thỏa thuận
float
totalDealValue
Tổng giá trị thỏa thuận
int
percentPriceChange
% thay đổi giá đóng cửa 1Y
float
marketCap
Tổng giá trị vốn hóa
int
Ví dụ:
from FiinQuantX import FiinSession
username = 'REPLACE_WITH_YOUR_USER_NAME'
password = 'REPLACE_WITH_YOUR_PASS_WORD'
client = FiinSession(username=username, password=password).login()
tickers = ["HPG", "MWG"]
data = client.PriceStatistics().get_overview(
tickers=tickers,
time_filter="Daily",
from_date="2025-08-20",
to_date="2025-08-27"
)
print(data)
Last updated