How to use multiple indicators with Technical Analysis API

Created by TradingAPI Support, Modified on Sat, 28 Sep at 4:39 AM by TradingAPI Support

To use the technical analysis endpoints for multiple indicators on a specific asset, you can use the Bulk Indicators endpoint. Here's how to do it:

  1. Endpoint: Use the Bulk Indicators endpoint: https://tradingapi.rest/v1/indicators
  2. HTTP Method: POST
  3. Headers:
    • Accept: "application/json"
    • Content-Type: "application/json"
    • X-API-KEY: Your API key
    • User-Agent: Your custom User Agent (optional)
  4. Request Body: Provide a JSON object with two main parts:
    • indicators: An array of indicators you want to analyze
    • data: Common parameters for all indicators

import requests

url = "https://tradingapi.rest/v1/indicators"
params = {
    "timestamp": 1
}
headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "X-API-KEY": "YOUR-API-KEY",
    "User-Agent": "YOUR-USER-AGENT"
}
data = {
    "indicators": [
        {
            "rsi": {
                "timeperiod": 14,
                "timestamp": 1,
                "reverse": 0
            }
        },
        "macd",
        "2crows",
        "bbands"  # Example of another indicator
    ],
    "data": {
        "exchange": "bybit",
        "limit": 50,
        "interval": "1m",
        "base": "BTC",
        "quote": "USDT",
        "reverse": 1,
        "timestamp": 0,
        "backtracks": 50,
        "backtrack": 50
    }
}

response = requests.post(url, params=params, headers=headers, json=data)
result = response.json()
print(result)

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article