Try Live
Add Docs
Rankings
Pricing
Enterprise
Docs
Install
Theme
Install
Docs
Pricing
Enterprise
More...
More...
Try Live
Rankings
Create API Key
Add Docs
XNO API
https://github.com/xno-quant/xnoapi
Admin
XNO API is a comprehensive, free, and open-source Python library for quantitative analysis and
...
Tokens:
26,768
Snippets:
92
Trust Score:
2.3
Update:
6 months ago
Context
Skills
Chat
Benchmark
60.9
Suggestions
Latest
Show doc for...
Code
Info
Show Results
Context Summary (auto-generated)
Raw
Copy
Link
# XNO API - Vietnamese Financial Markets Quantitative Analysis Library XNO API is a comprehensive Python library designed for quantitative financial analysis and data retrieval, specifically optimized for Vietnamese financial markets. The library provides access to Vietnamese stocks (HOSE, HNX, UPCOM), derivatives (VN30F1M, VN30F2M), mutual funds, and international market data including forex, cryptocurrencies, and global indices. It integrates multiple data sources including TCBS, VCI, Fmarket, MSN, and Yahoo Finance to deliver real-time and historical OHLCV data, financial statements, company information, and market snapshots. The library follows a modular architecture with separate packages for data retrieval (`xnoapi.vn.data`), performance metrics calculation (`xnoapi.vn.metrics`), and backtesting functionality (`xnoapi.vn.metrics.backtest`). It features robust error handling with retry mechanisms, smart caching strategies, and automatic pagination for large datasets. The design emphasizes ease of use with intuitive APIs while maintaining flexibility for advanced quantitative analysis workflows. XNO API supports both raw fundamental data and derived features including year-over-year growth metrics, technical indicators via TA-Lib integration, and custom fundamental scoring systems for Vietnamese banking and corporate sectors. --- ## API Reference and Code Examples ### Client Initialization Initialize API authentication for accessing XNO services. ```python from xnoapi import client # Initialize with your API key client(apikey="xd_your_api_key_here") # This must be called before making any API requests # API keys can be obtained from https://xno.vn ``` --- ### Historical Stock Data - Intraday and Hourly OHLCV Retrieve complete historical OHLCV (Open, High, Low, Close, Volume) data for Vietnamese stocks with automatic pagination. ```python from xnoapi.vn.data import get_stock_hist # Get minute-level data for VIC (Vingroup) vic_minute = get_stock_hist("VIC", resolution='m') print(vic_minute.head()) # Output columns: Date, time, Open, High, Low, Close, volume # Date time Open High Low Close volume # 0 2022-08-23 09:00:00 65.50 65.60 65.00 65.20 300000.0 # 1 2022-08-23 09:01:00 65.20 65.30 65.10 65.15 120000.0 # Get hourly data for HPG (Hoa Phat Steel) hpg_hourly = get_stock_hist("HPG", resolution='h') print(f"Total hourly bars: {len(hpg_hourly)}") # Returns all available historical data with automatic pagination # No 500-row limit - handles millions of data points efficiently ``` --- ### Derivatives Historical Data - High-Frequency Trading Access high-frequency derivatives data for VN30 futures with multiple timeframe support. ```python from xnoapi.vn.data import get_derivatives_hist # Get 1-minute bars for VN30F1M (front month contract) vn30_1m = get_derivatives_hist("VN30F1M", "1m") print(vn30_1m.head()) # Date time Open High Low Close volume # 0 2018-08-13 09:01:00 943.0 943.1 942.9 943.1 220.0 # 1 2018-08-13 09:02:00 943.0 943.6 943.0 943.5 121.0 # Get 5-minute aggregated data vn30_5m = get_derivatives_hist("VN30F1M", "5m") # Supported resolutions: "1m", "5m", "15m", "30m", "1H", "1D" # All data returned with Date, time, Open, High, Low, Close, volume ``` --- ### Market Index Snapshot - Real-Time Market Overview Get current market index information including trading statistics and price changes. ```python from xnoapi.vn.data import get_market_index_snapshot, get_indices, ping # Check API connectivity if ping(): print("✅ API connection successful") # Get list of available indices indices = get_indices() print(indices.head()) # symbol name # 0 HNX HNX # 1 HNX30 HNX30 # 2 VNINDEX VNINDEX # 3 VN30 VN30 # 4 VN100 VN100 # Get real-time VNINDEX snapshot vnindex = get_market_index_snapshot("VNINDEX") print(vnindex) # time symbol name prior value total_vol total_val advance decline nochange # 0 2025-08-22T14:45:15Z VNINDEX VNINDEX 1688 1645.469971 2234243072 6.067808e+12 71 251 27 ``` --- ### Stock Information - Real-Time Price and Trading Data Retrieve comprehensive real-time stock information including prices, matches, foreign trading, and order book depth. ```python from xnoapi.vn.data import ( get_stock_info, get_stock_matches, get_stock_top_price, get_stock_foreign_trading ) # Get current stock info for HPG stock_info = get_stock_info("HPG") print(stock_info) # symbol time open high low close avg ceil floor prior # HPG 2025-09-15T15:33:13Z 30.25 30.85 30.10 30.35 30.451 32.1 27.9 30 # Get latest matched orders matches = get_stock_matches("HPG") print(matches.head()) # time symbol price volume side # 0 2025-09-15T14:45:04Z HPG 30.35 50 S # Get order book top prices (bid/ask) top_price = get_stock_top_price("HPG") print(top_price) # Get foreign trading statistics foreign = get_stock_foreign_trading("HPG") print(foreign) # time symbol total_room current_room buy_vol sell_vol buy_val sell_val # 0 2025-09-15T15:33:13Z HPG 376098000 229122000 356690 942100 108758000000 286886000000 ``` --- ### Price Board - Multi-Symbol Real-Time Data Get consolidated real-time pricing data for multiple symbols with ceiling/floor prices and foreign trading info. ```python from xnoapi.vn.data import Trading # Get price board for multiple stocks symbols = ["VCB", "ACB", "TCB", "HPG", "VIC"] price_board = Trading.price_board(symbols) print(price_board) # Returns DataFrame with columns: # symbol, open, ceiling, floor, ref_price, high, low, # price_change, price_change_pct, foreign_volume, foreign_room, # foreign_holding_room, avg_match_volume_2w # Useful for quick market scanning and filtering filtered = price_board[price_board['price_change_pct'] > 2.0] print(f"Stocks up >2%: {filtered['symbol'].tolist()}") ``` --- ### Quote Class - Historical and Intraday Market Data Access historical OHLCV data and real-time intraday tick data via the Quote interface. ```python from xnoapi.vn.data import Quote # Initialize Quote object for ACB q = Quote("ACB") # Get historical daily data with date range hist_data = q.history(start="2024-01-01", end="2024-12-31", interval="1D") print(hist_data.head()) # time open high low close volume # 0 2024-01-02 00:00:00 24.50 24.80 24.30 24.75 15420000 # 1 2024-01-03 00:00:00 24.75 25.10 24.60 24.95 18930000 # Get hourly intraday data hourly = q.history(start="2024-12-01", end="2024-12-31", interval="1H") # Get latest tick-level intraday data ticks = q.intraday(page_size=200) print(ticks.head()) # Returns: time, price, volume, side, accumulated_volume # Get price depth (accumulated volume by price level) depth = q.price_depth() print(depth.head()) # Returns: price, acc_volume, acc_buy_volume, acc_sell_volume, acc_undefined_volume ``` --- ### Company Information - Corporate Data and Analysis Retrieve comprehensive company information including overview, profile, shareholders, officers, and events. ```python from xnoapi.vn.data import Company # Initialize Company object for VIC (Vingroup) company = Company("VIC") # Get company overview overview = company.overview() print(overview[['ticker', 'exchange', 'industry', 'stockRating']].iloc[0]) # ticker VIC # exchange HOSE # industry Bất động sản # stockRating 2.7 # Get detailed company profile profile = company.profile() print(profile.columns) # Get major shareholders with ownership percentage shareholders = company.shareholders(page_size=50) print(shareholders[['name', 'ownPercent']].head()) # name ownPercent # 0 Công ty Cổ Phần Tập Đoàn Đầu Tư Việt Nam 0.3249 # 1 Phạm Nhật Vượng 0.1160 # Get key officers/management officers = company.officers() print(officers[['name', 'position']].head()) # Get subsidiary companies subsidiaries = company.subsidiaries() # Get corporate events events = company.events(page_size=15) print(events[['title', 'date']].head()) # Get company news news = company.news(page_size=15) print(news[['title', 'publishDate']].head()) # Get financial ratios summary ratios = company.ratio_summary() print(ratios[['roe', 'roa', 'eps']].iloc[0]) # roe 0.095 # roa 0.016 ``` --- ### Financial Statements - Balance Sheet, Income Statement, Cash Flow Access complete financial statements with quarterly and annual reporting periods. ```python from xnoapi.vn.data import Finance # Initialize Finance object for HPG finance = Finance("HPG") # Get annual income statement income = finance.income_statement(period='year') print(income[['year', 'quarter', 'revenue', 'grossProfit', 'postTaxProfit']].head()) # year quarter revenue grossProfit postTaxProfit # 0 2024 5 138855000 18498000 12020000 # Get quarterly income statement income_q = finance.income_statement(period='quarter') print(f"Quarterly reports available: {len(income_q)}") # Get annual balance sheet balance = finance.balance_sheet(period='year') print(balance[['year', 'quarter', 'totalAsset', 'totalLiability', 'equity']].head()) # Get quarterly balance sheet balance_q = finance.balance_sheet(period='quarter') # Get annual cash flow statement cashflow = finance.cash_flow(period='year') print(cashflow[['year', 'quarter', 'netCashFromOperating', 'netCashFromInvesting', 'netCashFromFinancing']].head()) # All methods support dropna parameter to remove empty columns clean_income = finance.income_statement(period='quarter', dropna=True) ``` --- ### Mutual Funds - Fund Listings and Portfolio Holdings Search and analyze Vietnamese mutual funds with detailed portfolio and performance data. ```python from xnoapi.vn.data import Fund # Initialize Fund object fund = Fund() # Get all stock funds stock_funds = fund.listing(fund_type="STOCK") print(stock_funds[['name', 'code', 'nav', 'productNavChange.navTo1Months']].head()) # name code nav navTo1Months # 0 QUỸ ĐẦU TƯ CỔ PHIẾU NĂNG ĐỘNG BẢO VIỆT BVFED 31828.00 17.14 # 1 QUỸ ĐẦU TƯ CHỨNG KHOÁN NĂNG ĐỘNG DC VFMVF1 108787.18 13.97 # Get bond funds bond_funds = fund.listing(fund_type="BOND") # Get balanced funds balanced_funds = fund.listing(fund_type="BALANCED") # Search for specific fund by name search_result = fund.filter('RVPIF') print(search_result[['name', 'code']].head()) # Get fund NAV history report fund_code = "VFMVF1" nav_history = Fund.details.nav_report(fund_code) print(nav_history.head()) # Get fund's top holdings (portfolio composition) holdings = Fund.details.top_holding(fund_code) print(holdings[['symbol', 'weight', 'value']].head()) # Get industry allocation industry = Fund.details.industry_holding(fund_code) print(industry.head()) # Get asset allocation breakdown assets = Fund.details.asset_holding(fund_code) print(assets.head()) ``` --- ### Global Markets - FX, Crypto, and World Indices Access international market data including forex rates, cryptocurrencies, and global stock indices. ```python from xnoapi.vn.data import Global # Initialize Global market data object glb = Global() # Get USD/VND exchange rate history usdvnd = glb.fx("USDVND").quote.history(start="2024-01-01", end="2024-12-31") print(usdvnd.head()) # time open high low close volume # 0 2024-01-02 00:00:00 24350.0 24380.0 24340.0 24370.0 NaN # Get EUR/USD forex data eurusd = glb.fx("EURUSD").quote.history(start="2024-01-01", end="2024-12-31") # Get Bitcoin price history btc = glb.crypto("BTCUSD").quote.history(start="2024-01-01", end="2024-12-31") print(btc.head()) # time open high low close volume # 0 2024-01-02 00:00:00 44150.25 44890.75 43980.50 44567.30 28450000000 # Get Ethereum price history eth = glb.crypto("ETHUSD").quote.history(start="2024-01-01", end="2024-12-31") # Get S&P 500 index (INX = ^GSPC) sp500 = glb.world_index("INX").quote.history(start="2024-01-01", end="2024-12-31") print(sp500.head()) # Get Dow Jones Industrial Average dji = glb.world_index("DJI").quote.history(start="2024-01-01", end="2024-12-31") # Get Nikkei 225 nikkei = glb.world_index("N225").quote.history(start="2024-01-01", end="2024-12-31") # Calculate year-to-date returns def calc_return(df): if df.empty or df['close'].isna().all(): return 0 return (df['close'].iloc[-1] / df['close'].iloc[0] - 1) * 100 print(f"S&P 500 YTD: {calc_return(sp500):.2f}%") print(f"USDVND change: {calc_return(usdvnd):.2f}%") ``` --- ### Listing - Market Symbols and Exchange Information Get complete listings of tradeable symbols organized by exchange and market segment. ```python from xnoapi.vn.data import Listing # Initialize Listing object listing = Listing() # Get all available symbols with exchange info all_symbols = listing.all_symbols() print(all_symbols.head()) # symbol short_name exchange # 0 HPG HoaPhat HOSE # 1 VIC Vingroup HOSE # 2 VNM Vinamilk HOSE # Get symbols organized by exchange by_exchange = listing.symbols_by_exchange() print(by_exchange) # {'HOSE': ['HPG', 'VIC', 'VNM', ...], # 'HNX': ['ACB', 'SHS', ...], # 'UPCOM': [...]} # Count symbols per exchange for exchange, symbols in by_exchange.items(): print(f"{exchange}: {len(symbols)} symbols") # Get highly liquid assets from xnoapi.vn.data import list_liquid_asset liquid = list_liquid_asset() print(liquid.head()) # symbol volume_avg # 0 SHS 3.885972e+10 # 1 CEO 3.227357e+10 # 2 PVS 1.849527e+10 ``` --- ### Technical Analysis Integration - TA-Lib Features Add comprehensive technical indicators to price data using TA-Lib integration. ```python from xnoapi.vn.data import get_stock_hist, add_all_ta_features # Get historical data df = get_stock_hist("HPG", resolution='h') # Rename columns to match TA-Lib requirements df = df.rename(columns={ 'Open': 'Open', 'High': 'High', 'Low': 'Low', 'Close': 'Close', 'volume': 'Volume' }) # Add all technical indicators (requires: pip install ta) df_with_ta = add_all_ta_features( df, open='Open', high='High', low='Low', close='Close', volume='Volume', fillna=True ) # Check added indicators print(f"Original columns: {len(df.columns)}") print(f"With TA features: {len(df_with_ta.columns)}") # Common indicators now available: # - RSI: df_with_ta['momentum_rsi'] # - MACD: df_with_ta['trend_macd'], df_with_ta['trend_macd_signal'] # - Bollinger Bands: df_with_ta['volatility_bbh'], df_with_ta['volatility_bbl'] # - Moving Averages: df_with_ta['trend_sma_fast'], df_with_ta['trend_ema_fast'] # - Stochastic: df_with_ta['momentum_stoch'] # - ATR: df_with_ta['volatility_atr'] # And 50+ more indicators # Example: Simple RSI strategy rsi = df_with_ta['momentum_rsi'] df_with_ta['signal'] = 0 df_with_ta.loc[rsi < 30, 'signal'] = 1 # Oversold - buy df_with_ta.loc[rsi > 70, 'signal'] = -1 # Overbought - sell ``` --- ### Fundamental Features - YoY Growth and Financial Scoring Add derived fundamental features including year-over-year growth metrics and financial health scores. ```python from xnoapi.vn.data import Company, merge_fund_into_price, add_all_fund_features from xnoapi.vn.data import get_stock_hist # Get price and fundamental data price_df = get_stock_hist("VCB", resolution='h') company = Company("VCB") fund_df = company.ratio_summary() # Ensure fund_df has required columns if 'ticker' not in fund_df.columns: fund_df['ticker'] = "VCB" # Add derived fundamental features (YoY, ratios, flags) fund_with_features = add_all_fund_features( fund_df, ticker_col='ticker', year_col='year', quarter_col='quarter', stable_div_years=3, enable_capex_proxy_for_F36=True, drop_nan_threshold=1.0, cast_binary_to_int=True ) print("Added features:") feature_cols = [c for c in fund_with_features.columns if c.endswith('_yoy') or c.startswith('eps_') or c.startswith('roe_')] print(feature_cols) # Merge fundamental features into price data with quarterly lag merged_df = merge_fund_into_price( price_df=price_df, fund_df=fund_with_features, price_date_col='Date', price_time_col='time', ticker_col='ticker', quarter_col='quarter', year_col='year', assume_ticker='VCB', report_release_lag_days=45, # Assume 45-day reporting delay drop_all_nan_cols=True ) print(merged_df.head()) # Now you have price data with point-in-time fundamental features # Example: Filter periods where ROE is improving and EPS growing if 'eps_yoy_up' in merged_df.columns and 'roe_gt15_yoy_up' in merged_df.columns: quality_periods = merged_df[ (merged_df['eps_yoy_up'] == 1) & (merged_df['roe_gt15_yoy_up'] == 1) ] print(f"High quality periods: {len(quality_periods)} bars") ``` --- ### Backtesting Derivatives - VN30 Futures Strategy Testing Backtest derivatives trading strategies with Vietnamese market fee structure and overnight charges. ```python from xnoapi.vn.data import get_derivatives_hist from xnoapi.vn.metrics import Backtest_Derivates, Metrics import numpy as np import pandas as pd # Get VN30F1M data (5-minute bars) df = get_derivatives_hist("VN30F1M", "5m") # Create simple moving average crossover strategy df['sma_fast'] = df['Close'].rolling(window=20).mean() df['sma_slow'] = df['Close'].rolling(window=50).mean() # Generate position signals (1 = long, -1 = short, 0 = flat) df['position'] = 0 df.loc[df['sma_fast'] > df['sma_slow'], 'position'] = 1 # Long df.loc[df['sma_fast'] < df['sma_slow'], 'position'] = -1 # Short # Clean date/time columns df['Date'] = pd.to_datetime(df['Date']).dt.strftime('%Y-%m-%d') df['time'] = pd.to_datetime(df['time'], format='%H:%M:%S').dt.strftime('%H:%M:%S') # Run backtest with fee calculation backtest = Backtest_Derivates(df, pnl_type='after_fees') # Get cumulative PNL cumulative_pnl = backtest.PNL() print(f"Final PNL: {cumulative_pnl.iloc[-1]:,.0f} points") # Get daily aggregated PNL daily_pnl = backtest.daily_PNL() print(f"Total trading days: {len(daily_pnl)}") # Estimate minimum capital required min_capital = backtest.estimate_minimum_capital() print(f"Minimum capital needed: {min_capital:,.0f} VND") # Calculate performance metrics metrics = Metrics(backtest) print("\n=== Strategy Performance ===") print(f"Sharpe Ratio: {metrics.sharpe():.3f}") print(f"Sortino Ratio: {metrics.sortino():.3f}") print(f"Calmar Ratio: {metrics.calmar():.3f}") print(f"Max Drawdown: {metrics.max_drawdown()*100:.2f}%") print(f"Win Rate: {metrics.win_rate()*100:.1f}%") print(f"Profit Factor: {metrics.profit_factor():.3f}") print(f"Avg Win: {metrics.avg_win():.2f}") print(f"Avg Loss: {metrics.avg_loss():.2f}") print(f"Value at Risk (5%): {metrics.value_at_risk(0.05):.2f}") print(f"Risk of Ruin: {metrics.risk_of_ruin():.6f}") ``` --- ### Backtesting Stocks - Long-Only Equity Strategy Backtest stock trading strategies with T+2 settlement rules and Vietnamese transaction fees. ```python from xnoapi.vn.data import get_stock_hist from xnoapi.vn.metrics import Backtest_Stock, Metrics import pandas as pd # Get HPG hourly data df = get_stock_hist("HPG", resolution='h') # Create RSI mean reversion strategy def calculate_rsi(close, period=14): delta = close.diff() gain = (delta.where(delta > 0, 0)).rolling(window=period).mean() loss = (-delta.where(delta < 0, 0)).rolling(window=period).mean() rs = gain / loss return 100 - (100 / (1 + rs)) df['rsi'] = calculate_rsi(df['Close']) # Generate position signals (number of shares) # Buy 1000 shares when oversold, sell when overbought df['position'] = 0 df.loc[df['rsi'] < 30, 'position'] = 1000 # Oversold - buy df.loc[df['rsi'] > 70, 'position'] = 0 # Overbought - sell # Forward fill positions (hold until next signal) df['position'] = df['position'].replace(0, method='ffill').fillna(0) # Run backtest with T+3 settlement constraint and 0.1% transaction fee backtest = Backtest_Stock( df, pnl_type='after_fees', min_hold_days=3 # Vietnamese T+2 settlement (hold minimum 3 sessions) ) # Get results cumulative_pnl = backtest.PNL() print(f"Final PNL: {cumulative_pnl.iloc[-1]:,.0f} VND") # Daily PNL daily_pnl = backtest.daily_PNL() print(f"Best day: {daily_pnl.diff().max():,.0f} VND") print(f"Worst day: {daily_pnl.diff().min():,.0f} VND") # Capital requirements min_capital = backtest.estimate_minimum_capital() print(f"Minimum capital: {min_capital:,.0f} VND") # Return percentage pnl_pct = backtest.PNL_percentage() print(f"Final return: {pnl_pct.iloc[-1]*100:.2f}%") # Calculate metrics metrics = Metrics(backtest) print("\n=== Stock Strategy Metrics ===") print(f"Sharpe Ratio: {metrics.sharpe():.3f}") print(f"Max Drawdown: {metrics.max_drawdown()*100:.2f}%") print(f"Win Rate: {metrics.win_rate()*100:.1f}%") print(f"Avg Daily Turnover: {backtest.avg_pos():.0f} shares") # Plot equity curve backtest.plot_PNL(title="HPG RSI Mean Reversion Strategy") ``` --- ### Fund Feature Engineering - Advanced Fundamental Signals Create sophisticated fundamental scoring features for quantitative stock selection. ```python from xnoapi.vn.data import Company, fund_feature import pandas as pd # Get fundamental data with derived features for VCB # This returns price data merged with single fundamental feature df = fund_feature( feature_name='eps_yoy_up', # EPS year-over-year growth flag symbol='VCB', timeframe='h', report_release_lag_days=45, force_refresh=False ) print(df.head()) # Date time Open High Low Close Volume eps_yoy_up # 0 2022-08-23 09:00:00 85.50 85.60 85.00 85.20 300000.0 1.0 # Available fundamental features (examples): features_to_check = [ 'earningPerShare', # Raw EPS value 'bookValuePerShare', # Book value per share 'roe', # Return on equity 'roa', # Return on assets 'priceToEarning', # P/E ratio 'priceToBook', # P/B ratio 'eps_yoy_up', # EPS growing YoY (binary flag) 'eps_up_4p', # EPS growing 4 consecutive periods 'roe_gt15_yoy_up', # ROE > 15% and improving 'roa_gt8_yoy_up', # ROA > 8% and improving 'curr_gt1_5_yoy_up', # Current ratio > 1.5 and improving 'quick_gt1_yoy_up', # Quick ratio > 1 and improving 'bvps_yoy_up', # Book value per share increasing 'asset_turnover_yoy_up', # Asset turnover improving 'gpa_yoy_up', # Gross profit margin × asset turnover improving 'charter_cap_yoy_up', # Charter capital increasing (dilution) ] # Build multi-feature dataset price_df = None for feature in features_to_check[:5]: # Get first 5 features try: df_feat = fund_feature( feature_name=feature, symbol='VCB', timeframe='h', report_release_lag_days=45 ) if price_df is None: price_df = df_feat else: # Merge only the new feature column price_df = price_df.merge( df_feat[['Date', 'time', feature]], on=['Date', 'time'], how='left' ) except Exception as e: print(f"Could not get {feature}: {e}") print(f"Created dataset with {len(price_df.columns)} columns") # Create composite quality score if 'eps_yoy_up' in price_df.columns and 'roe_gt15_yoy_up' in price_df.columns: price_df['quality_score'] = ( price_df['eps_yoy_up'].fillna(0) + price_df['roe_gt15_yoy_up'].fillna(0) + price_df.get('roa_gt8_yoy_up', 0).fillna(0) ) print(f"Quality score range: {price_df['quality_score'].min()} - {price_df['quality_score'].max()}") ``` --- ## Summary and Integration Patterns XNO API provides a complete ecosystem for Vietnamese financial market quantitative analysis, from data acquisition to strategy backtesting. The library excels in three primary use cases: market data aggregation for multi-asset portfolios (stocks, derivatives, funds, forex), fundamental and technical analysis workflows combining company financials with price action, and systematic strategy development with realistic Vietnamese market constraints including T+2 settlement, transaction fees, and overnight charges. The modular design allows researchers to start with simple data retrieval and progressively build sophisticated quantitative models without switching frameworks. Integration patterns follow a natural progression: initialize the client with an API key, retrieve historical or real-time data using the appropriate module (stocks, derivatives, funds, global), enrich datasets with technical indicators via TA-Lib or fundamental features via the fund_feature system, generate trading signals based on custom logic or machine learning models, validate strategies using the backtesting framework with accurate fee calculations, and analyze performance using comprehensive metrics including Sharpe, Sortino, Calmar ratios, drawdown analysis, and risk-adjusted returns. The library's caching mechanisms, automatic pagination, and robust error handling ensure reliable operation in production environments while maintaining clean, readable code that accelerates the research-to-deployment cycle for quantitative trading systems targeting Vietnamese markets.