Technical Indicator Query
Calculates and returns historical data for common technical indicators like MACD, RSI, BOLL, etc., based on specified financial instrument contract code, K-line timeframe, and indicator parameters.
Documentation
API Capabilities
This API is used to calculate and query technical indicator data for global financial instruments. It supports various mainstream technical indicators suchs as MACD, RSI, BOLL, EMA, KDJ, CCI, ATR, etc. Developers can specify the contract code, K-line timeframe, and specific indicator parameters to obtain the calculated indicator value sequences.
Request and Response
- Request Parameters: Must include
symbol(contract code),period(timeframe, e.g., 1M, 15M, 1H, D, etc.),indkey(indicator key, e.g., macd), andargs(indicator parameters, a URL-encoded JSON string). Optionally,outputcountcan be passed to control the number of outputs (max 500). - Response Result: Returns the indicator calculation results for the specified timeframe. For example, the MACD indicator will return values such as timestamp (Tick), histogram (Histogram), DIF (Macd), and DEA (Signal).
Use Cases
- Market Charting: Provide rich technical indicator data sources for frontend K-line chart components, assisting users with technical analysis.
- Quantitative Trading Strategies: Dynamically obtain technical indicator values for specific timeframes during strategy execution, serving as criteria for buy/sell signals.
- Market Monitoring and Alerts: Build automated market alert systems based on indicator data (e.g., RSI overbought/oversold, MACD golden cross/death cross).
Usage Instructions and Limitations
- The
argsparameter in the request must strictly adhere to the parameter format of the corresponding indicator; otherwise, calculation may fail or results may be abnormal. - Indicator data is calculated based on historical K-lines. Calculation results may vary due to parameter settings or underlying data source differences; please verify in actual applications.
- The API outputs a maximum of the latest 500 indicator data points, suitable for recent market analysis, but not for very long-period historical data backtesting.
Integration Examples
Includes ready-to-use Shell, Python, Go, Java, and PHP examples for direct integration.
Request Example
{
"symbol": "合约代码(参考连接 http://demo.konpn.com/symbols.shtml )。指标数据只输出最新的10个。计算数据可能因参数原因导致有误,请反...",
"period": "周期取 15S(可能有),1M,3M,5M,10M,15M,30M,1H,2H,4H,D(W周,M月可能有)",
"indkey": "指标Key,支持指标这里查询 map.konpn.com:10002/localrm/query/indicatorlist",
"outputcount": "输出数量,最多500",
"args": "指标参数,json的urlencode传入。对应指标参数格式这里查询 map.konpn.com:10002/localrm/query/indicatorge..."
}Response Example
{
"Tick": 1624636800,
"Histogram": -405.5369,
"Macd": -1953.8285,
"Signal": -1751.06
}Request Fields
The fields below are derived from example JSON for integration reference only.
| Path | Type | Sample |
|---|---|---|
| type | string | object |
| properties | object | {...} |
| properties.symbol | object | {...} |
| properties.symbol.type | string | string |
| properties.symbol.description | string | 合约代码(参考连接 http://demo.konpn.com/symbols.shtml )。指标数据只输出最新的10个。计算数据可能因参数原因导致有误,请反馈 |
| properties.period | object | {...} |
| properties.period.type |
Response Fields
The fields below are derived from example JSON for integration reference only.
| Path | Type | Sample |
|---|---|---|
| type | string | object |
| properties | object | {...} |
| properties.Tick | object | {...} |
| properties.Tick.type | string | number |
| properties.Tick.example | number | 1624636800 |
| properties.Histogram | object | {...} |
| properties.Histogram.type | string |