Originally, TradingView API does not provide any possibilities to get favourite indications (f.e. rsi, macd or bollinger bands). It gives only well shaped UI snippet that can be integrated with frontend and that's it.
This MVP tries to solve the problem, by giving a free REST API, which can provide latest indicator data by requested:
- time frame
- symbol
- indicator name
Works only with ByBit crypto exchange (for now). Currently supported indications:
- rsi
- macd
- bollinger bands
Supported time frames:
- minute
- hour
- day
Service limitations:
- max indicator limitation: 10 (configurable)
- max indicator range: 240 for minutes and hours, 120 for days (configurable)
From the beginning the user with ADMIN role must use POST end point to add indicators. Then users can get list of supported indications per symbol, time frame and request data. More details are described below.
Below is a table of REST endpoints defined in TechIndicatorController.
| Method | Endpoint | Parameters | Description | Authorization |
|---|---|---|---|---|
| GET | /v1/tech/indicators |
— | Fetch all available technical indicators | Not required |
| GET | /v1/{symbol}/tech/indicators/{indicatorName} |
symbol — [a-zA-Z]{1,10}indicatorName — stringtimeFrame — query param |
Retrieve indicator data for a specific symbol | Not required |
| POST | /v1/{symbol}/tech/indicators/{indicatorName} |
symbol — [a-zA-Z]{1,10}indicatorName — stringtimeFrame — query param |
Add a new technical indicator for a symbol | Requires ADMIN role |
| DELETE | /v1/{symbol}/tech/indicators/{indicatorName} |
symbol — [a-zA-Z]{1,10}indicatorName — stringtimeFrame — query param |
Removes technical indicator for a symbol | Requires ADMIN role |
GET /v1/tech/indicators
{
"btcUSDT": [
{
"name": "rsi",
"size": 225,
"last": "50.19",
"timeFrame": "hour"
},
{
"name": "bolBands",
"size": 221,
"last": "87421.64,88552.39,86290.88",
"timeFrame": "hour"
}
],
"ethUSDT": [
{
"name": "bolBands",
"size": 221,
"last": "2863.28,2933.56,2793.01",
"timeFrame": "hour"
}
]
}
GET /v1/eth/tech/indicators/rsi?timeFrame=hour
Response example:
{
"coin": "ethUSDT",
"timeFrame": "hour",
"data": [
"48.71",
"48.49",
...
"53.97"
]
}
- The client sends a GET request.
- The controller constructs an
IndicatorRequest. TechIndicatorManagerprocesses the request:- validates parameters;
- fetches kline data from exchange;
- calculates the requested indicator;
- runs socket subscription to requested channel in order to keep indicator data updated
- returns the result to the controller.
- The controller responds back to the client.
Main components:
- Tech Indicator Controller: handles user requests, performs request validation, forwards requests to service layer
- Indicator Data Provider: stores indicator data and updates it, according to web socket ticker, kline subscriptions
- Tech Indicator Manager: processes users requests after additional business related validations
- Trade History Manager: stores and updates trade history by time frame and symbols
- Public Web Socket Manager: establishes socket channels with Bybit exchange to listen latest kline and ticker events
- Java 21
- Spring Boot 3
- Feign Client
- WebSockets
- Jackson
- Gson
- JUnit 5
- GitHub Actions
For local IDE only: use local run config with added VM option:
-Dspring.profiles.active=bybit
Docker run:
docker build -t crypto-analysis-tech-provider .
docker run -d --name crypto-analysis-tech-provider \
-p 8084:8084 \
crypto-analysis-tech-provider
Most exciting vectors of improvements are presented below:
- different exchanges support (Binance, CoinBase, Kraken etc...)
- different indicators support (ADX, EMA, ATR etc...)
- security part (enabling https, adding jwt)
- indicator data persistence for accumulating of bigger data volumes per exchange, symbol, indicator, time frame
- socket subscription to provide latest changes of indications
- further improvements of data accuracy generation
GNU 3
