-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc05897
commit 8206390
Showing
6 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# go-exchange-api | ||
|
||
Проект для получения данных с бирж MOEX и SPBEX для использования с [Portfolio-Performance](https://www.portfolio-performance.info/). | ||
|
||
## Ограничения | ||
|
||
Для биржи Moex требуется использовать Redis для кеширования истории цен. Также для нее данные запаздывают на один торговый день - условно, получаете данные _за вчера._ | ||
|
||
## Как развернуть | ||
|
||
Проще всего использовать `docker`: | ||
|
||
```bash | ||
docker compose up -d | ||
``` | ||
|
||
```yaml | ||
version: '3' | ||
|
||
services: | ||
redis-cache: | ||
image: redis:7-alpine | ||
volumes: | ||
- redis:/data | ||
|
||
exchange-api: | ||
image: kotasha/go-exchange-api:latest | ||
environment: | ||
EXCHANGE_API_REDIS: redis://redis-cache:6379/0 | ||
ports: | ||
- 8080:8080/tcp | ||
|
||
volumes: | ||
redis: | ||
``` | ||
## Как проверить | ||
```bash | ||
curl http://localhost/moex/sber | jq | ||
``` | ||
|
||
![Test](images/image-3.png) | ||
|
||
Вместо биржи `moex` также можно использовать `spbex`. | ||
|
||
## Как настроить Portfolio Performance | ||
|
||
Во вклакде `All Securities` нажимаем знак `⊕`, а затем `Empty instrument`. | ||
|
||
![Empty instrument](images/image.png) | ||
|
||
На вкладке `Security Master Data` заполняем название актива, бумагу и тикер. | ||
|
||
![Description](images/image-1.png) | ||
|
||
На вкладке `Historical Quotes` выбираем `Provider: JSON` и заполняем поля: | ||
|
||
```params | ||
Feed URL: http://localhost:8080/moex/{TICKER} | ||
Path to Date: [*].date | ||
Path to Close: [*].close | ||
Path to Day's Low: [*].low | ||
Path to Day's High: [*].high | ||
Path to Volume: [*].volume | ||
``` | ||
|
||
![Security Parameters](images/image-2.png) | ||
|
||
Результат: | ||
|
||
![Result](images/image-4.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.