Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Data retrieval

Examples of historical data retrieval

Historical data retrieval

import FiinQuantX as fq
# Đăng nhập
username = 'REPLACE_WITH_YOUR_USER_NAME'
password = 'REPLACE_WITH_YOUR_PASS_WORD'

client = fq.FiinSession(username=username, password=password).login()
fi = client.FiinIndicator()
# Lấy dữ liệu có sẵn
tickers = ['HPG','SSI','VN30'] 
event = client.Fetch_Trading_Data(
    realtime = False,
    tickers = tickers,    
    fields = ['open','high','low','close','volume','bu','sd','fn','fs','fb'],
    adjusted=True,  
    # period=10,
    from_date='2024-12-04',
    by = '1m'
    )
df = event.get_data()
print(df)

Explanation of data fields:

  • open, high, low, close: Represent open, high, low, close prices.

  • volume: Represents matching order volume.

  • bu, sd: Active buy/sell indicators.

  • fn, fs, fb: Foreign net, foreign sell, foreign buy, representing foreign investor net buy/sell, buy, or sell values.

Real-time data retrieval

Find the ATC buy/sell volume of VN30

VN30 ATC volume

Last updated