Skip to main content
Glama

Taiwan Stocks

Get price history and technicals

get_price_history
Read-onlyIdempotent

Daily and intraday price bars, trade-by-trade details and technical analysis for Taiwan stocks, ETFs and TAIFEX futures. Data comes from the CubeLV Market Data API (https://cubelv.com/en/mcp/taiwan-stocks/): pick a method and pass its arguments in args. US markets are available only for the ADRs of Taiwan companies.

Methods:

  • history (Candlesticks (OHLCV)): Daily, weekly, monthly and intraday candles. TWSE/TPEx stocks and ETFs: 1d, 1w, 1mo (optionally adjusted for ex-rights/ex-dividend and splits) and 1m, 3m, 5m, 15m, 30m, 60m; today's daily candle appears after the 13:30 close (volume is board-lot trading until the exchange daily file arrives around 15:00, then it also includes odd lots and after-hours fixed-price trading). TAIFEX futures: daily candles for all products since 1998 (regular session) via continuous codes (TXF1, CDF3, MXFW1) or a specific month (TXF202611). TAIFEX intraday candles (1m, 3m, 5m, 15m, 30m, 60m) use the front/next continuous code (product code plus 1 or 2) or MXFW1 and include the current session: TAIEX TXF, mini TAIEX MXF, electronics EXF, finance FXF, non-finance non-electronics XIF and TWD gold TGF since 2011-01-03, gold GDF since 2011-01-05, TOPIX TJF since 2015-12-21, MXFW1 since 2013-07-31; US index futures Dow UDF and S&P 500 SPF since 2017-05-15, Nasdaq-100 UNF since 2019-10-01, PHLX Semiconductor SXF since 2023-12-18. The night session of US index futures (session night, 15:00-05:00 Taipei time, dated to the next trading day) covers US regular trading hours, so for intraday Nasdaq, Dow, S&P 500 or semiconductor index history over several years query UNF1, UDF1, SPF1 or SXF1 (volume is TAIFEX contracts, far smaller than CME). Sessions: 1m and 3m have day and night sessions (night since TAIFEX opened it: TXF, MXF, UDF, SPF 2017-05-15; UNF, SXF from their first day; EXF 2018-11-20; GDF, TGF 2018-07-03; TJF 2024-12-10; FXF 2025-06-24; XIF has no night session); 5m to 60m: TXF, MXF, SPF, UNF, SXF day and night, UDF night only, EXF, FXF, XIF, GDF, TGF, TJF, MXFW1 day only. Front/next month of FTSE Taiwan TWN, MSCI Taiwan MTW, Hang Seng HSI, FTSE China A50 CN and Nikkei NK have day-session 5m to 60m only (since 2026-03-27), no 1m or 3m. US stocks: 1d, 60m, 30m, 15m, 5m are split/dividend-adjusted, 1m and 3m are raw; 5m to 60m are the same 1-minute data as 1m (bundle files where available, otherwise aggregated from 1m and adjusted like the daily candles), so every day with 1m also has 5m to 60m: the market-wide range is the dataset us_minute_bars, and each symbol starts at its own first 1m day. Taiwan index daily candles exist for TAIEX, the TPEx index and sector indices (see dailyHistory in indices); warrants have daily candles only. Returns the most recent limit candles within from-to (default 240, max 8000); page backwards through long histories (limit 8000 per segment for years of intraday candles) by setting to to the day before the earliest candle returned until the result is empty. Args: market (required): Market: TWSE, TPEX, TAIFEX, NASDAQ, NYSE or AMEX (US ETFs listed on NYSE Arca or Cboe BZX use AMEX); a market/symbol mismatch returns 404; symbol (required): Symbol (US preferred shares like ABR$D). TAIFEX daily: continuous code (TXF1, CDF3, MXFW2) or specific month (TXF202611, MXF202610W4); TAIFEX intraday: front/next continuous code (TXF1, UNF1, UDF2) or MXFW1; from: Start date, YYYYMMDD; to: End date, YYYYMMDD; limit: Most recent N candles within from-to (default 240, about one year of daily candles; max 8000, larger values count as 8000). For earlier or longer histories read in segments with from and to: limit 8000 per segment for years of intraday candles, setting the next segment's to to the day before the earliest candle returned, until the result is empty; interval: Candle interval: 1d, 1w, 1mo, 1m, 3m, 5m, 15m, 30m, 60m. Taiwan stocks: all; TAIFEX: 1d for all contracts, intraday for front/next continuous codes and MXFW1 (products, sessions and start dates in the summary); US stocks: 1d, 60m, 30m, 15m, 5m, 3m, 1m. US 5m, 15m, 30m, 60m and 1m are the same data: bundle files where available, otherwise aggregated from regular-session 1m and adjusted to the same day's adjusted daily candle (unfinished candles are not returned); US 3m is aggregated from raw 1m. Each candle's at is its end time; adjusted: Adjust Taiwan daily/weekly/monthly candles for ex-rights/ex-dividend and splits (available from 20030505 for TWSE and 20000901 for TPEx; an earlier from returns 422). US daily and 5m-60m candles are always adjusted; session: Intraday session: day = regular session, night = after-hours session (TAIFEX night session 15:00-05:00 Taipei time, dated to the next trading day), all = both (default). TAIFEX daily candles cover the regular session only.

  • trades (Trade-by-trade details and buy/sell pressure): Tick-by-tick trades of one Taiwan stock on a trading day (newest first, page with before) plus outside (buy-initiated), inside (sell-initiated) and unclassified volume; available from 2018-12-07 (not for warrants). If date is omitted, the latest trading day with intraday trades is used (looking back up to 5 trading days). outerVolume, innerVolume, unknownVolume and totalTrades are whole-day totals independent of limit and before, so use limit=1 when only totals are needed. One symbol per request; intraday requests replay the whole day and get slower with more trades, so for many symbols use the sides field of quotes, or subscribe for live updates. Up to 5000 trades per page. Args: market (required): Market: TWSE or TPEX; symbol (required): Symbol (uppercase letters/digits and . _ -, up to 32 chars); date: Trading day, YYYYMMDD, not after today; when given only that day is queried; limit: Trades per page (1-5000, default 200); before: Pagination cursor: nextBefore from the previous page (HHMMSS[mmm|uuuuuu][:sequence]).

  • volumeProfile (Volume profile): Estimated volume traded at each price over recent trading days, built from 1-minute candles, with the point of control (POC) and the 70% value area. by=price gives one row per Taiwan tick-size price level. Up to 120 trading days. Args: market (required): Market: TWSE or TPEX; symbol (required): Symbol (uppercase letters/digits and . _ -, up to 32 chars); date: Last trading day included, YYYYMMDD, not after today; days: Number of trading days (1-120, default 20); bins: Number of equal-width price bins for by=range (1-200, default 64); not allowed with by=price; by: range = equal-width price bins; price = one row per Taiwan tick-size price level between the low and high, untraded levels filled with 0; maxRows: Maximum rows for by=price (1-200, default 40); more levels are merged from the top, levelsPerRow adjacent levels per row.

  • trend (Multi-timeframe technical trend score): Moving averages, KD (stochastic), MACD, RSI, Bollinger Bands, ATR(14) and a strength rating for the 1m, 3m, 5m, 15m, 30m, 60m and 1d timeframes; 1d uses adjusted daily candles and adds daily: distance from the 20/50/200-day moving averages, 52-week high/low, highest/lowest price and peak-volume dates over recent N candles, returns over week/month/quarter/half-year/year/YTD, and one- and three-year beta against 0050 (Taiwan) or SPY (US). US stocks (NASDAQ, NYSE, AMEX) have 1d only. Args: market (required): Market: TWSE, TPEX, NASDAQ, NYSE or AMEX; symbol (required): Symbol (uppercase letters/digits and . _ -, up to 32 chars; US preferred shares may use $, e.g. ABR$D); date: Use only candles on or before this date, YYYYMMDD (Taipei date), not after today; timeframes: Comma-separated timeframes, each once, up to 7; default for Taiwan is all (1m,3m,5m,15m,30m,60m,1d), US has 1d only; extremeDays: Comma-separated lookbacks N for daily.extremes, each once, up to 6 values of 2-500; default 5,20,60,120,240.

  • priceSimulation (Price simulation (Monte Carlo)): Geometric Brownian motion Monte Carlo on adjusted daily candles: drift from the past year's annualized return (drift=zero for none), volatility from EWMA (lambda 0.94) historical volatility by default, simulating the price distribution over the next N trading days. Returns daily 5/25/50/75/95 percentiles (up to 64 points), the terminal price distribution (30 bins), probability of rising, probabilities of moving 10/20/30%, expected return and 95% VaR. Results are deterministic for the same inputs. A statistical simulation, not a forecast. Args: market (required): Market: TWSE, TPEX (Taiwan) or NASDAQ, NYSE, AMEX (US); symbol (required): Symbol (Taiwan 2330, US AAPL; US share classes as BRK.B); date: Use only daily candles on or before this date, YYYYMMDD (Taipei date, not after today); default latest; days: Trading days to simulate ahead (1-504, default 60); paths: Number of simulated paths (100-20000, default 5000); drift: historical = past year's annualized return as drift; zero = no drift, volatility only; volatility: Annualized volatility in percent (e.g. 30); default EWMA historical volatility.

  • correlation (Correlation matrix): Pearson correlation matrix of up to 12 series: stocks and ETFs use daily log returns of adjusted closes, daily macro series (e.g. macro:US.TREASURY.10Y, crude oil, the dollar index) use daily changes (percentage-point differences for series in %). Uses the most recent days common trading days; window adds rolling correlation of each series against the first (up to 120 points), and each series' annualized volatility and beta against the first. Args: symbols (required): Comma-separated 2-12 series: MARKET:SYMBOL (TWSE, TPEX, NASDAQ, NYSE, AMEX; US = any US exchange, e.g. US:SPY) or macro:<daily macro series id from macroSeries, e.g. macro:US.TREASURY.10Y>. The first series is the base for rolling correlation and beta; days: Number of most recent common trading days (30-1260, default 252); window: Rolling correlation window in trading days (10-252, default 60); 0 = no rolling correlation; date: Use only data on or before this date, YYYYMMDD (Taipei date, not after today); default latest.

  • optionPricing (Option theoretical value calculator): Theoretical option values on a stock from its adjusted daily candles using Black-Scholes (with continuous dividend yield), a CRR binomial tree (American early exercise) and Monte Carlo, with Greeks (delta, gamma, vega and rho per 1 percentage point, daily theta), intrinsic and time value, break-even price and probability of expiring in the money (risk-neutral and from the past year's returns). With price (market premium) it also returns implied volatility, the gap to theoretical value, buyer's profit probability, expected return and a Kelly fraction. Defaults: EWMA historical volatility; rate = US 3-month Treasury yield (US) or the central bank discount rate (Taiwan). These are model values from historical volatility, not exchange option quotes. Args: market (required): Market: TWSE, TPEX (Taiwan) or NASDAQ, NYSE, AMEX (US); symbol (required): Underlying symbol (Taiwan 2330, US AAPL; US share classes as BRK.B); type (required): call or put; strike (required): Strike price (same unit as the stock price); expiry: Expiry date, YYYYMMDD, after the latest daily candle and within 5 years; use either expiry or days; days: Calendar days to expiry (1-1825); required when expiry is not given; style: european or american (affects the binomial tree only); default american for US, european for Taiwan; price: Option market price (premium); enables implied volatility, gap and Kelly outputs; volatility: Annualized volatility in percent; default EWMA historical volatility; rate: Risk-free rate in percent; default US 3-month Treasury yield (US) or the discount rate (Taiwan); dividendYield: Continuous dividend yield in percent; default from the US screener snapshot (US) or 0 (Taiwan); steps: Binomial tree steps (10-2000, default 300); paths: Monte Carlo paths (1000-200000, default 50000); date: Use only daily candles on or before this date, YYYYMMDD (Taipei date, not after today); default latest.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "method": "<method>"
    },
    "name": "get_price_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoArguments of the method, as listed in the tool description
langNoLanguage for data labels (industries, statement items, categories) and links: en, ja, ko or vi; default en
methodYesMethod from the list in the tool description

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the read-only and idempotent annotations, the description discloses important behavior: pagination and limits, adjustment rules, session definitions, market/symbol mismatch returning 404, earlier adjusted history returning 422, and slower whole-day intraday replays. These details materially affect how an agent should call the tool and interpret results.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long, but the length is largely justified by seven distinct methods and many market-specific constraints. It is front-loaded with an overview and method list, though some session and interval details are dense and repetitive enough to reduce readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of an output schema and the complexity of the tool, the description is unusually complete: it covers method coverage, required and optional arguments, defaults, limits, sessions, adjustments, error conditions, and paging behavior. An agent has enough information to select a method and construct valid calls.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema leaves method-specific arguments under a generic args object, so the description carries almost all parameter meaning. It documents each method's arguments, allowed markets, date formats, limits, defaults, enum-like values, and special cases such as TAIFEX continuous codes and US share classes.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb/resource set: daily and intraday price bars, tick trades, volume profile, technical trend scores, simulations, correlation, and option pricing for Taiwan stocks, ETFs, and TAIFEX futures. It also states the data source and the method-based interface, so an agent can identify the tool's scope without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear method-level guidance and some alternatives, such as using the sides field of quotes or subscribing for live updates when handling many symbols instead of repeated intraday trades calls. It does not give a top-level when-to-use-this-vs-get_quotes rule, but the method contexts and constraints are otherwise explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources