Feature function

Functions specifically developed for FiinQuant allow users to utilize them immediately, without needing to develop the problem themselves.

Rebalance function

By inputting the investable value and the index code, the algorithm will calculate the quantity of shares needed to most closely match the proportion of stocks in the index basket. This is applied in arbitrage trading and passive investment.

The Rebalance function utilizes publicly available data from the Stock Exchange regarding Free-float Ratio and Marketcap Limit, combined with real-time closing prices from the FiinGroup system.

Rebalancing is performed based on the principle that the proportion of volume remains unchanged within a portfolio. Therefore, to effectively track an index, a portfolio manager only needs to construct a portfolio where the proportional quantity of shares matches the proportion of the index being tracked. This approach ensures the lowest possible Tracking Error.

The output is "Share to Buy", based on the input of the Budget (VND) and the Ticker (Index) to be rebalanced.

Danh sách vã số lượng cần mua của mỗi mã cổ phiếu

SimilarChart function

Allows users to quickly search through a large number of stock codes to find the 5 codes with the closest price trends to the stock of interest.

5 mã cổ phiếu có xu hướng gần nhất với mã ACB hiện tại

Parameter

Paraneter
Description
Data type
Default

Ticker

Applied ticker code

Ticker

None

t1

Start time of the candle cluster

str

t2

End time of the candle cluster

str

FindDateCorrelation function

Use this function to find the correlation between today's data and historical data for a specific code.

Ví dụ tìm kiếm tương quan cho VN30F1M trong 1 năm dữ liệu so với ngày hiện tại

Parameter

Parameter
Data type
Default
Default value
Description

Ticker

Union[str, list[str]]

Required

None

Stock code or list of stock codes to analyze

Timeframe

str

Required

1M

Intraday trading data timeframe (e.g., '1m', '5m', '1h').

t1

str

Optional

9am or 13pm

Start time (if needed).

t2

str

Optional

None

End time (if needed).

method

str

Optional

"pearson correlation"

Distance measurement method (1: Euclidean, 2: DTW, 3: Pearson, 4: Cosine).

year

int

Optional

1

Number of past years of data to compare.

Copy the code snippet to run the example above.

Output khi chạy đoạn code trên

SeasonalityPrice function

This function is used to plot the correlation of price changes for one or more stock codes over a period.

Monthly price change table for VCB
Sharpe Ratio by month

Last updated