Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikkhvat/candlestick-charts
Microservice that writes Forex data to the database and converts them to candlestick charts
https://github.com/nikkhvat/candlestick-charts
candlestick-chart forex forex-data golang microservice postgresql websocket
Last synced: about 1 month ago
JSON representation
Microservice that writes Forex data to the database and converts them to candlestick charts
- Host: GitHub
- URL: https://github.com/nikkhvat/candlestick-charts
- Owner: nikkhvat
- Created: 2022-08-16T23:16:58.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-17T00:09:38.000Z (over 2 years ago)
- Last Synced: 2023-09-18T18:08:56.231Z (over 1 year ago)
- Topics: candlestick-chart, forex, forex-data, golang, microservice, postgresql, websocket
- Language: Go
- Homepage:
- Size: 74.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![bars](./bars.png)
# Forex Data ๐
forex (golang) - Microservice that works with Streaming API Key
- โ Getting real-time data (websocket)
- โ Proxy web socket server for data
- โ Save data to db (PostgreSQL)
- โ History rest request (Generate Candlestick chart) (GET) /?startDate /?endDate /?symbol /?timeframe
- โ Get up-to-date data now /?symbolRaw socket data
```json
{
"symbol": "LTCUSD",
"ts": "1660694052026",
"bid": 61.348,
"ask": 61.353,
"mid": 61.350502
}
```Candlestick chart Data
```json
[{
"open": 61.5284602,
"close": 61.5655,
"high": 61.600502,
"low": 61.5284602,
"timestamp": 1660571731680
}]
```## Requests
### Request example getting historical data
GET -> `https://domain/forex/hostory?start_date=1660567220494&end_date=1660567787724&symbol=ETHUSD&timeframe=60`
- end_date - end date (timestamp)
- start_date - start date (timestamp)
- symbol - currency pair
- timeframe - in seconds### Example getting up-to-date data now by symbol
GET -> `https://domain/forex/actual?symbol=ETHUSD`
- symbol - currency pair### Example ping
GET -> `https://domain/forex/ping`
### Example socket
WS -> `wss://domain:3495/forexws`
## Run
in `.env` file:
```.env
key=qwerft_wedrftg
nominals=EURCAD,EURUSD,GBPAUD,AUDCHF,CHFJPY,EURNZD
```>key - Streaming API Key
>nominals - ะกomma-separated list of currency pair
run on port: `3495`
Before launching, create a database in PostgreSql
```sql
CREATE DATABASE forex;
```