Skip to content

Commit

Permalink
Merge pull request #16 from Tinkoff/dev
Browse files Browse the repository at this point in the history
fix shares duplicate
  • Loading branch information
jstalex authored Jul 25, 2023
2 parents 2b7a37d + c9cbdb3 commit d3ed955
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ MaxRetries uint `yaml:"MaxRetries"`
```

#### 3. Запуск

> **Важно!** В примерах роботов `interval_bot` и загрузчика стаканов `order_book_download` используется драйвер
для sqlite, который [является cgo пакетом](https://github.com/mattn/go-sqlite3#installation). Перед запуском убедитесь, что
на вашем компьютере установлен gcc.

Пример использования `MarketDataStreamService`:

go run md_stream.go
Expand Down
6 changes: 6 additions & 0 deletions examples/interval_bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ const (
позиции за `cancelAhead` до конца торгов текущего дня.

### Запуск

> **Важно!** В примерах роботов `interval_bot` и загрузчика стаканов `order_book_download` используется драйвер
для sqlite, который [является cgo пакетом](https://github.com/mattn/go-sqlite3#installation). Перед запуском убедитесь, что
на вашем компьютере установлен gcc.


Клонируйте репозиторий

git clone https://github.com/tinkoff/invest-api-go-sdk
Expand Down
10 changes: 0 additions & 10 deletions examples/interval_bot/cmd/candles_downloader/download_candles.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,6 @@ func main() {
// рублевые акции c московской биржи
shares := sharesResp.GetInstruments()

for _, share := range shares {
if len(instrumentIds) > INSTRUMENTS_MAX-1 {
break
}
exchange := strings.EqualFold(share.GetExchange(), EXCHANGE)
currency := strings.EqualFold(share.GetCurrency(), CURRENCY)
if exchange && currency && !share.GetForQualInvestorFlag() {
instrumentIds = append(instrumentIds, share.GetUid())
}
}
for _, share := range shares {
if len(instrumentIds) > INSTRUMENTS_MAX-1 {
break
Expand Down
8 changes: 8 additions & 0 deletions examples/ob_bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,16 @@ SellOut bool

### Запуск

> **Важно!** В примерах роботов `interval_bot` и загрузчика стаканов `order_book_download` используется драйвер
для sqlite, который [является cgo пакетом](https://github.com/mattn/go-sqlite3#installation). Перед запуском убедитесь, что
на вашем компьютере установлен gcc.

Клонируете репозиторий

git clone https://github.com/tinkoff/invest-api-go-sdk

Перейдите в папку с ботом

cd invest-api-go-sdk/examples/ob_bot

Создайте файл `config.yaml`
Expand Down

0 comments on commit d3ed955

Please sign in to comment.