Skip to content

Commit

Permalink
readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kiberdruzhinnik committed Jan 23, 2024
1 parent bc05897 commit 8206390
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions README.md
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)
Binary file added images/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/image-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/image-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 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.
Binary file added images/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8206390

Please sign in to comment.