SuperAPI AI Directory

tigeropen-java

Coding & development

View repository

Updated 10-16 07:57

About this skill

TradeUP OpenAPI — Java SDK (US Market)

Complete AI skill set for the TradeUP OpenAPI Java SDK, scoped to U.S. stocks and options.

Safety Warning: Trading involves real money. Default to the Paper Trading account when generating trading code unless the user explicitly requests live trading. Always print order details and require explicit confirmation before placing live orders. Never log or echo private-key fields.

Scope

This skill covers U.S. market only. Supported instruments:

Instrument Live Paper
Stocks, ETFs (incl. fractional shares, Live only) ✅ ✅
Options ✅ ✅

Out of scope (use the global tigeropen-skill instead): Hong Kong, Singapore, Australia, China A-shares, futures, funds, crypto, warrants, multi-leg combo orders, TWAP/VWAP algo orders.

Reference Guides

Load the relevant guide for your task:

  • Quickstart — Maven / Gradle setup, configuration (license=TBUS, PKCS#8), TigerHttpClient, request / response model, enum reference
  • Market Data — Market status, calendar, real-time quotes, K-lines, depth, ticks, intraday, capital flow
  • Options — Option expirations, chains, briefs, depth, ticks, K-lines, plus the Java-only option indicator (Greeks) calculation
  • Scanner — Stock screener
  • Trading — Place / preview / modify / cancel orders, contract queries, order info
  • Real-time Push — WebSocketClient and ApiComposeCallback, quote / depth / tick / minute K-line / order / position / asset / transaction subscriptions
  • Account — Account list, prime / paper assets, asset history analysis, transferable funds, deposit / withdrawal records, max tradable quantity

Quick Start

import com.tigerbrokers.stock.openapi.client.config.ClientConfig;
import com.tigerbrokers.stock.openapi.client.https.client.TigerHttpClient;
import com.tigerbrokers.stock.openapi.client.https.request.quote.QuoteMarketRequest;
import com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteMarketResponse;
import com.tigerbrokers.stock.openapi.client.struct.enums.Market;

// 1. Configuration (loads tiger_openapi_config.properties from configFilePath)
ClientConfig clientConfig = ClientConfig.DEFAULT_CONFIG;
clientConfig.configFilePath = "/Users/demo/props/";    // directory containing properties file
// Or assign explicitly:
// clientConfig.tigerId = "your_tiger_id";
// clientConfig.defaultAccount = "your_account";
// clientConfig.privateKey = "your_pkcs8_private_key";  // base64 DER, PKCS#8 for Java
// clientConfig.license = License.TBUS;

// 2. Create client
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(clientConfig);

// 3. Query U.S. market status
QuoteMarketResponse response = client.execute(QuoteMarketRequest.newRequest(Market.US));
System.out.println(response);

When to Use Each Reference

Task Reference
First-time setup, Maven dependency, auth config quickstart.md
Stock quotes, K-lines, intraday, capital flow quote.md
Option chains, briefs, Greeks, indicator calculation option.md
Stock screening, filtering by financial fields scanner.md
Place / modify / cancel orders, query orders trade.md
Real-time streaming via WebSocket push.md
Accounts, prime / paper assets, transfers, deposit history account.md

Common U.S. Symbols

Common name Symbol
Apple AAPL
Microsoft MSFT
Tesla TSLA
NVIDIA NVDA
Google / Alphabet GOOGL / GOOG
Amazon AMZN
Meta / Facebook META
Netflix NFLX
TSMC TSM
AMD AMD
TradeUP / Tiger / TIGR TIGR
Alibaba ADR BABA
JD.com ADR JD
PDD / Pinduoduo PDD
S&P 500 ETF SPY
Nasdaq-100 ETF QQQ
Russell 2000 ETF IWM
Dow ETF DIA
Treasury 20Y ETF TLT
Volatility Index ETF VXX

Critical Facts

  • License: U.S. accounts use License.TBUS / license=TBUS. Other licenses (TBHK, TBSG, etc.) will be rejected by the API.
  • Private key format (Java): PKCS#8 (private_key_pk8 field in the properties file). Python uses PKCS#1 — do not mix them up.
  • Maven dependency: io.github.tigerbrokers:openapi-java-sdk:2.4.3. The global skill uses the same io.github.tigerbrokers group.
  • Default language: Language.en_US.
  • Extended hours: Set outsideRth=true on stock orders for pre-market and after-hours fills. Market and Stop orders are not supported in extended hours.
  • Fractional shares: Live accounts only. Set cashAmount (not totalQuantity) for cash-based orders.
  • Time-in-force: DAY or GTC (GTC up to 180 days). Market orders and Paper Trading do not support GTC.
  • Index options: Only Friday-expiring contracts are tradeable except IWM/SPY/QQQ which support all listed expirations.
  • Direction reversal: Cannot directly flip from long to short (or vice versa) in a single order. Close the existing position first.