3.1. Báo cáo tài chí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.

fs_dict = client.FundamentalAnalysis().get_financial_statement(
    tickers=tickers,
    statement=statement,
    years=years,
    quarters=quarters,
    audited=True,
    type=type,
    fields=fields
)

Tham số:

Tên tham số
Mô tả
Kiểu dữ liệu
Mặc định
Bắt buộc

tickers

Danh sách mã được viết in hoa.

str hoặc list

statement

Loại báo cáo tài chính, là 1 trong 3 giá trị ‘balancesheet’, ‘incomestatement’, ‘cashflow’, hoặc ‘full’ là lấy hết. Nếu muốn lấy nhiều loại báo cáo tài chính thì liệt kê list các loại ra.

str

years

Năm của kỳ báo cáo, có thể chọn nhiều năm bằng cách liệt kê list các năm ra

list[int]

quarters

Quý của kỳ báo cáo, nếu không truyền mặc định lấy báo cáo tài chính của năm dựa trên tham số year, có thể chọn nhiều quý bằng cách liệt kê list các quý ra

list[int]

None

Không

audited

Kiểm toán hay chưa (True là đã kiểm toán, False là chưa kiểm toán).

bool

type

1 trong 2 giá trị (‘consolidated’ hoặc ‘separate’). 'consolidated' là báo cáo tài chính hợp nhất, 'separate' là báo cáo tài chính công ty mẹ

str

fields

Trường dữ liệu cần lấy (không truyền sẽ lấy hết). Biến fields có thể truyền theo dạng đường dẫn phân cấp cách nhau bằng dấu chấm ('Assets'.'CurrentAssets' – Lấy phần Tài sản ngắn hạn trong báo cáo tài chính) hoặc truyền thẳng sections là node cần lấy ('CurrentAssets').

str

None

Không

Class nhận dữ liệu là FundamentalAnalysis và có phương thức nhận dữ liệu là get_financial_statement()

### pseudocode
import json

fs_dict = client.FundamentalAnalysis().get_financial_statement(
    tickers=tickers,
    statement="balancesheet",
    years=[2024],
    quarters=[4],
    audited=True,
    type="consolidated"
)

print(json.dumps(fs_dict, indent=4))
  • Ví dụ lấy dữ liệu full bảng cân đối kế toán của báo cáo tài chính hợp nhất đã kiểm toán quý 4 năm 2024 của mã HPG

import json

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']

fs_dict = client.FundamentalAnalysis().get_financial_statement(
    tickers=tickers,
    statement="balancesheet",
    years=[2024],
    quarters=[4],
    audited=True,
    type="consolidated"
)

print(json.dumps(fs_dict, indent=4))
  • Ví dụ lấy dữ liệu phần TỔNG TÀI SẢN thuộc bảng cân đối kế toán của báo cáo tài chính hợp nhất đã kiểm toán quý 4 năm 2024 của mã HPG

import json

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']

fs_dict = client.FundamentalAnalysis().get_financial_statement(
    tickers=tickers,
    statement="balancesheet",
    years=[2024],
    quarters=[4],
    audited=True,
    type="consolidated",
    fields=["Assets"]
)

print(json.dumps(fs_dict, indent=4))
  • Ví dụ lấy dữ liệu phần TÀI SẢN NGẮN HẠN nằm trong phần TỔNG TÀI SẢN thuộc bảng cân đối kế toán của báo cáo tài chính hợp nhất đã kiểm toán quý 4 năm 2024 của mã HPG

import json

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']

fs_dict = client.FundamentalAnalysis().get_financial_statement(
    tickers=tickers,
    statement="balancesheet",
    years=[2024],
    quarters=[4],
    audited=True,
    type="consolidated",
    fields=["CurrentAssets"]
)

print(json.dumps(fs_dict, indent=4))

Last updated