Thanks to visit codestin.com
Credit goes to github.com

Skip to content

blackchestnut/invest_tinkoff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

59 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

invest_tinkoff

Ruby Rest API client

Install

gem install invest_tinkoff

Requirements

  • Ruby 2.3.0 or higher

Docs

RubyDoc.info

API v2

client = InvestTinkoff::V2::Client.new token: 'ВАШ_Π’ΠžΠšΠ•Π'

Бправочная ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ ΠΎ Ρ†Π΅Π½Π½Ρ‹Ρ… Π±ΡƒΠΌΠ°Π³Π°Ρ…

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния ΠΎΠ±Π»ΠΈΠ³Π°Ρ†ΠΈΠΈ ΠΏΠΎ Π΅Ρ‘ ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€Ρƒ

https://tinkoff.github.io/investAPI/instruments/#bondby

# @id_type: InvestTinkoff::V2::InstrumentIdType
# @id: String
# @class_code: String (ΠžΠ±ΡΠ·Π°Ρ‚Π΅Π»Π΅Π½ ΠΏΡ€ΠΈ id_type = TICKER)

bond_by id_type:, id:, class_code: nil

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния списка ΠΎΠ±Π»ΠΈΠ³Π°Ρ†ΠΈΠΉ

https://tinkoff.github.io/investAPI/instruments/#bonds

# @instrument_status: InvestTinkoff::V2::InstrumentStatus

bonds instrument_status: InvestTinkoff::V2::InstrumentStatus::BASE

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния списка Π²Π°Π»ΡŽΡ‚

https://tinkoff.github.io/investAPI/instruments/#currencies

# @instrument_status: InvestTinkoff::V2::InstrumentStatus

currencies instrument_status: InvestTinkoff::V2::InstrumentStatus::BASE

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния Π²Π°Π»ΡŽΡ‚Ρ‹ ΠΏΠΎ Π΅Ρ‘ ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€Ρƒ

https://tinkoff.github.io/investAPI/instruments/#currencyby

# @id_type: InvestTinkoff::V2::InstrumentIdType
# @id: String
# @class_code: String (ΠžΠ±ΡΠ·Π°Ρ‚Π΅Π»Π΅Π½ ΠΏΡ€ΠΈ id_type = TICKER)

currency_by id_type:, id:, class_code: nil

ΠœΠ΅Ρ‚ΠΎΠ΄ рСдактирования ΠΈΠ·Π±Ρ€Π°Π½Π½Ρ‹Ρ… инструмСнтов

https://tinkoff.github.io/investAPI/instruments/#editfavorites

# @figis: String, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: ['BBG000B9XRY4', 'BBG000BWXBC2']
# @action_type: InvestTinkoff::V2::EditFavoritesActionType

edit_favorites figis:, action_type: InvestTinkoff::V2::EditFavoritesActionType::ADD

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния инвСстиционного Ρ„ΠΎΠ½Π΄Π° ΠΏΠΎ Π΅Π³ΠΎ ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€Ρƒ

https://tinkoff.github.io/investAPI/instruments/#etfby

# @id_type: InvestTinkoff::V2::InstrumentIdType
# @id: String
# @class_code: String (ΠžΠ±ΡΠ·Π°Ρ‚Π΅Π»Π΅Π½ ΠΏΡ€ΠΈ id_type = TICKER)

etf_by id_type:, id:, class_code: nil

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния списка инвСстиционных Ρ„ΠΎΠ½Π΄ΠΎΠ²

https://tinkoff.github.io/investAPI/instruments/#etfs

# @instrument_status: InvestTinkoff::V2::InstrumentStatus

etfs instrument_status: InvestTinkoff::V2::InstrumentStatus::BASE

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния Ρ„ΡŒΡŽΡ‡Π΅Ρ€ΡΠ° ΠΏΠΎ Π΅Π³ΠΎ ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€Ρƒ

https://tinkoff.github.io/investAPI/instruments/#futureby

# @id_type: InvestTinkoff::V2::InstrumentIdType
# @id: String
# @class_code: String (ΠžΠ±ΡΠ·Π°Ρ‚Π΅Π»Π΅Π½ ΠΏΡ€ΠΈ id_type = TICKER)

future_by id_type:, id:, class_code: nil
# ΠŸΡ€ΠΈΠΌΠ΅Ρ€Ρ‹:

client.future_by id_type: InvestTinkoff::V2::InstrumentIdType::FIGI, id: 'FUTSI0323000'
client.future_by id_type: InvestTinkoff::V2::InstrumentIdType::TICKER, id: 'SiH3', class_code: 'SPBFUT'

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния списка Ρ„ΡŒΡŽΡ‡Π΅Ρ€ΡΠΎΠ²

https://tinkoff.github.io/investAPI/instruments/#futures

# @instrument_status: InvestTinkoff::V2::InstrumentStatus

futures instrument_status: InvestTinkoff::V2::InstrumentStatus::BASE

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния Π½Π°ΠΊΠΎΠΏΠ»Π΅Π½Π½ΠΎΠ³ΠΎ ΠΊΡƒΠΏΠΎΠ½Π½ΠΎΠ³ΠΎ Π΄ΠΎΡ…ΠΎΠ΄Π° ΠΏΠΎ ΠΎΠ±Π»ΠΈΠ³Π°Ρ†ΠΈΠΈ

https://tinkoff.github.io/investAPI/instruments/#getaccruedinterests

# @figi: String, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 'BBG00X6ZGSY7'
# @from: Time, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 1.year.ago
# @to: Time, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 2.months.from_now

accrued_interests figi:, from:, to:

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния Π°ΠΊΡ‚ΠΈΠ²Π° ΠΏΠΎ Π΅Π³ΠΎ ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€Ρƒ

https://tinkoff.github.io/investAPI/instruments/#getassetby

# @id: String, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: '9f083982-cf4c-418a-a0bf-8b82f16db42d'

asset_by id:

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния списка Π°ΠΊΡ‚ΠΈΠ²ΠΎΠ²

https://tinkoff.github.io/investAPI/instruments/#getassets

assets

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния Π³Ρ€Π°Ρ„ΠΈΠΊΠ° Π²Ρ‹ΠΏΠ»Π°Ρ‚ ΠΊΡƒΠΏΠΎΠ½ΠΎΠ² ΠΏΠΎ ΠΎΠ±Π»ΠΈΠ³Π°Ρ†ΠΈΠΈ

https://tinkoff.github.io/investAPI/instruments/#getbondcoupons

# @figi: String, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 'BBG00X6ZGSY7'
# @from: Time, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 1.year.ago
# @to: Time, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 6.months.from_now

bond_coupons figi:, from:, to:

ΠœΠ΅Ρ‚ΠΎΠ΄ для получСния событий Π²Ρ‹ΠΏΠ»Π°Ρ‚Ρ‹ Π΄ΠΈΠ²ΠΈΠ΄Π΅Π½Π΄ΠΎΠ² ΠΏΠΎ инструмСнту

https://tinkoff.github.io/investAPI/instruments/#getdividends

# @figi: String, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 'BBG000B9XRY4'
# @from: Time, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 1.year.ago
# @to: Time, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 1.month.from_now

dividends figi:, from:, to:

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния ΠΈΠ·Π±Ρ€Π°Π½Π½Ρ‹Ρ… инструмСнтов

https://tinkoff.github.io/investAPI/instruments/#getfavorites

favorites

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния Ρ€Π°Π·ΠΌΠ΅Ρ€Π° Π³Π°Ρ€Π°Π½Ρ‚ΠΈΠΉΠ½ΠΎΠ³ΠΎ обСспСчСния ΠΏΠΎ Ρ„ΡŒΡŽΡ‡Π΅Ρ€ΡΠ°ΠΌ

https://tinkoff.github.io/investAPI/instruments/#getfuturesmargin

# @figi: String

futures_margin figi:

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния основной ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ ΠΎΠ± инструмСнтС

https://tinkoff.github.io/investAPI/instruments/#getinstrumentby

# @id_type: InvestTinkoff::V2::InstrumentIdType
# @id: String
# @class_code: String (ΠžΠ±ΡΠ·Π°Ρ‚Π΅Π»Π΅Π½ ΠΏΡ€ΠΈ id_type = TICKER)

instrument_by id_type:, id:, class_code: nil
# ΠŸΡ€ΠΈΠΌΠ΅Ρ€Ρ‹:

client.instrument_by id_type: InvestTinkoff::V2::InstrumentIdType::FIGI, id: 'FUTSI0323000'
client.instrument_by id_type: InvestTinkoff::V2::InstrumentIdType::TICKER, id: 'SiH3', class_code: 'SPBFUT'

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния Π°ΠΊΡ†ΠΈΠΈ ΠΏΠΎ Π΅Ρ‘ ΠΈΠ΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€Ρƒ

https://tinkoff.github.io/investAPI/instruments/#shareby

# @id_type: InvestTinkoff::V2::InstrumentIdType
# @id: String
# @class_code: String (ΠžΠ±ΡΠ·Π°Ρ‚Π΅Π»Π΅Π½ ΠΏΡ€ΠΈ id_type = TICKER)

share_by id_type:, id:, class_code: nil
# ΠŸΡ€ΠΈΠΌΠ΅Ρ€Ρ‹:

client.share_by id_type: InvestTinkoff::V2::InstrumentIdType::FIGI, id: 'BBG000B9XRY4'
client.share_by id_type: InvestTinkoff::V2::InstrumentIdType::TICKER, id: 'AAPL', class_code: 'SPBXM'

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния списка Π°ΠΊΡ†ΠΈΠΉ

https://tinkoff.github.io/investAPI/instruments/#shares

# @instrument_status: InvestTinkoff::V2::InstrumentStatus

shares instrument_status: InvestTinkoff::V2::InstrumentStatus::BASE

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния расписания Ρ‚ΠΎΡ€Π³ΠΎΠ² Ρ‚ΠΎΡ€Π³ΠΎΠ²Ρ‹Ρ… ΠΏΠ»ΠΎΡ‰Π°Π΄ΠΎΠΊ

https://tinkoff.github.io/investAPI/instruments/#tradingschedulesrequest

# @exchange: String, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 'MOEX'
# @from: Time, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 1.day.from_now
# @to: Time, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 5.days.from_now

trading_schedules exchange:, from:, to:

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΡ Π±ΠΈΡ€ΠΆΠ΅Π²ΠΎΠΉ ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ

ΠœΠ΅Ρ‚ΠΎΠ΄ запроса историчСских свСчСй ΠΏΠΎ инструмСнту

https://tinkoff.github.io/investAPI/marketdata/#getcandles

# @figi: String, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 'BBG000B9XRY4'
# @from: Time, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 1.hour.ago
# @to: Time, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: Time.zone.now
# @interval: InvestTinkoff::V2::CandleInterval

candles(
  figi:,
  from:,
  to:,
  interval: InvestTinkoff::V2::CandleInterval::HOUR
)

ΠœΠ΅Ρ‚ΠΎΠ΄ запроса послСдних Ρ†Π΅Π½ ΠΏΠΎ инструмСнтам

https://tinkoff.github.io/investAPI/marketdata/#getlastprices

# @figis: [String]

last_prices figis:
# ΠŸΡ€ΠΈΠΌΠ΅Ρ€Ρ‹:
client.last_prices figis: ['BBG0013HGFT4', 'BBG0013HJJ31']

ΠœΠ΅Ρ‚ΠΎΠ΄ запроса послСдних ΠΎΠ±Π΅Π·Π»ΠΈΡ‡Π΅Π½Π½Ρ‹Ρ… сдСлок ΠΏΠΎ инструмСнту

https://tinkoff.github.io/investAPI/marketdata/#getlasttrades

# @figi: String, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 'BBG000B9XRY4'
# @from: Time, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 1.hour.ago
# @to: Time, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: Time.zone.now

last_trades figi:, from:, to:

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния стакана ΠΏΠΎ инструмСнту

https://tinkoff.github.io/investAPI/marketdata/#getorderbook

# @figi: String, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 'BBG000B9XRY4'
# @depth: Integer

order_book figi:, depth: 10

ΠœΠ΅Ρ‚ΠΎΠ΄ запроса статуса Ρ‚ΠΎΡ€Π³ΠΎΠ² ΠΏΠΎ инструмСнтам

https://tinkoff.github.io/investAPI/marketdata/#gettradingstatus

# @figi: String, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 'BBG000B9XRY4'

trading_status figi:

ΠžΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΈ ΠΏΠΎ счёту

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния списка ΠΎΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΉ ΠΏΠΎ счёту

https://tinkoff.github.io/investAPI/operations/#getoperations

# @account_id: String
# @figi: String, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 'BBG000B9XRY4'
# @from: Time
# @to: Time
# @state (ΠΎΠΏΠΈΡ†ΠΈΠΎΠ½Π°Π»ΡŒΠ½ΠΎ): InvestTinkoff::V2::OperationState

operations(
  account_id:,
  figi:,
  from:,
  to:,
  state: InvestTinkoff::V2::OperationState::UNSPECIFIED
)

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния портфСля ΠΏΠΎ счёту

https://tinkoff.github.io/investAPI/operations/#getportfolio

# @account_id: String

portfolio account_id:

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния списка ΠΏΠΎΠ·ΠΈΡ†ΠΈΠΉ ΠΏΠΎ счёту

https://tinkoff.github.io/investAPI/operations/#getpositions

# @account_id: String

positions account_id:

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния доступного остатка для Π²Ρ‹Π²ΠΎΠ΄Π° срСдств

https://tinkoff.github.io/investAPI/operations/#getwithdrawlimits

# @account_id: String

withdraw_limits account_id:

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния брокСрского ΠΎΡ‚Ρ‡Ρ‘Ρ‚Π° NotImplemented

https://tinkoff.github.io/investAPI/operations/#getbrokerreport

broker_report

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния ΠΎΡ‚Ρ‡Ρ‘Ρ‚Π° "Π‘ΠΏΡ€Π°Π²ΠΊΠ° ΠΎ Π΄ΠΎΡ…ΠΎΠ΄Π°Ρ… Π·Π° ΠΏΡ€Π΅Π΄Π΅Π»Π°ΠΌΠΈ Π Π€" NotImplemented

https://tinkoff.github.io/investAPI/operations/#getdividendsforeignissuer

dividends_foreign_issuer

Π’ΠΎΡ€Π³ΠΎΠ²Ρ‹Π΅ поручСния

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния списка Π°ΠΊΡ‚ΠΈΠ²Π½Ρ‹Ρ… заявок ΠΏΠΎ счёту

https://tinkoff.github.io/investAPI/orders/#getorders

# @account_id: String

orders account_id:

ΠœΠ΅Ρ‚ΠΎΠ΄ выставлСния заявки

https://tinkoff.github.io/investAPI/orders/#postorder

# @account_id: String
# @figi: String
# @quantity: Integer
# @price: Float
# @direction: InvestTinkoff::V2::OrderDirection
# @order_type: InvestTinkoff::V2::OrderType
# @order_id: String (max length 36)

create_order(
  account_id:,
  figi:,
  quantity:,
  price:,
  direction:,
  order_type:,
  order_id:
)
# ΠŸΡ€ΠΈΠΌΠ΅Ρ€:

client.create_order(
  account_id: 'ВАШ_ID_БЧЁВА',
  figi: 'BBG000BL9C59',
  quantity: 1,
  price: 11.35,
  direction: InvestTinkoff::V2::OrderDirection::BUY,
  order_type: InvestTinkoff::V2::OrderType::LIMIT,
  order_id: 'ВАШ_Π’ΠΠ£Π’Π Π•ΠΠΠ˜Π™_ID_Π—ΠΠ―Π’ΠšΠ˜'
)

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния статуса Ρ‚ΠΎΡ€Π³ΠΎΠ²ΠΎΠ³ΠΎ поручСния

https://tinkoff.github.io/investAPI/orders/#getorderstate

# @account_id: String
# @order_id: String

order_state account_id:, order_id:

ΠœΠ΅Ρ‚ΠΎΠ΄ ΠΎΡ‚ΠΌΠ΅Π½Ρ‹ Π±ΠΈΡ€ΠΆΠ΅Π²ΠΎΠΉ заявки

https://tinkoff.github.io/investAPI/orders/#cancelorder

# @account_id: String
# @order_id: String

cancel_order account_id:, order_id:

Π‘Ρ‚ΠΎΠΏ-заявки

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния списка Π°ΠΊΡ‚ΠΈΠ²Π½Ρ‹Ρ… стоп заявок ΠΏΠΎ счёту

https://tinkoff.github.io/investAPI/stoporders/#getstoporders

# @account_id: String

stop_orders account_id:

ΠœΠ΅Ρ‚ΠΎΠ΄ выставлСния стоп-заявки

https://tinkoff.github.io/investAPI/stoporders/#poststoporder

# @account_id: String
# @figi: String, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 'BBG000B9XRY4'
# @quantity: Integer
# @price: Float
# @stop_price: Float
# @expiration_type: InvestTinkoff::V2::StopOrderExpirationType
# @stop_order_type: InvestTinkoff::V2::StopOrderType

create_stop_order(
  account_id:,
  figi:,
  quantity:,
  price:,
  stop_price:,
  expire_date:,
  expiration_type: InvestTinkoff::V2::StopOrderExpirationType::UNSPECIFIED,
  stop_order_type: InvestTinkoff::V2::StopOrderType::UNSPECIFIED,
)

ΠœΠ΅Ρ‚ΠΎΠ΄ ΠΎΡ‚ΠΌΠ΅Π½Ρ‹ стоп-заявки

https://tinkoff.github.io/investAPI/stoporders/#cancelstoporder

# @account_id: String
# @order_id: String

cancel_stop_order account_id:, order_id:

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ справочной ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ ΠΎ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ Π’ΠΈΠ½ΡŒΠΊΠΎΡ„Ρ„ Π˜Π½Π²Π΅ΡΡ‚ΠΈΡ†ΠΈΠΉ

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния счСтов ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Ρ

https://tinkoff.github.io/investAPI/users/#getaccounts

accounts

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ ΠΎ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅

https://tinkoff.github.io/investAPI/users/#getinfo

info

Расчёт ΠΌΠ°Ρ€ΠΆΠΈΠ½Π°Π»ΡŒΠ½Ρ‹Ρ… ΠΏΠΎΠΊΠ°Π·Π°Ρ‚Π΅Π»Π΅ΠΉ ΠΏΠΎ счёту

https://tinkoff.github.io/investAPI/users/#getmarginattributes

# @account_id: String

margin_attributes account_id:

Π’Π΅ΠΊΡƒΡ‰ΠΈΠΉ Ρ‚Π°Ρ€ΠΈΡ„ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Ρ (Π»ΠΈΠΌΠΈΡ‚Ρ‹ запросов ΠΊ API)

https://tinkoff.github.io/investAPI/users/#getusertariff

user_tariff

API v2 Sandbox

client = InvestTinkoff::V2::SandboxClient.new token: 'ВАШ_Π’ΠžΠšΠ•Π_ΠŸΠ•Π‘ΠžΠ§ΠΠ˜Π¦Π«'

ΠžΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΈ Π² sandbox

ΠœΠ΅Ρ‚ΠΎΠ΄ ΠΎΡ‚ΠΌΠ΅Π½Ρ‹ Ρ‚ΠΎΡ€Π³ΠΎΠ²ΠΎΠ³ΠΎ поручСния Π² пСсочницС

https://tinkoff.github.io/investAPI/sandbox/#cancelsandboxorder

# @account_id: String
# @order_id: String

cancel_sandbox_order account_id:, order_id:

ΠœΠ΅Ρ‚ΠΎΠ΄ закрытия счёта Π² пСсочницС

https://tinkoff.github.io/investAPI/sandbox/#closesandboxaccount

# @account_id: String

close_sandbox_account account_id:

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния счСтов Π² пСсочницС

https://tinkoff.github.io/investAPI/sandbox/#getsandboxaccounts

sandbox_accounts

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния ΠΎΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΉ Π² пСсочницС ΠΏΠΎ Π½ΠΎΠΌΠ΅Ρ€Ρƒ счёта

https://tinkoff.github.io/investAPI/sandbox/#getsandboxoperations

# @account_id: String
# @figi: String, ΠΏΡ€ΠΈΠΌΠ΅Ρ€: 'BBG000B9XRY4'
# @from: Time
# @to: Time
# @state (ΠΎΠΏΠΈΡ†ΠΈΠΎΠ½Π°Π»ΡŒΠ½ΠΎ): InvestTinkoff::V2::OperationState

sandbox_operations(
  account_id:,
  figi:,
  from:,
  to:,
  state: InvestTinkoff::V2::OperationState::UNSPECIFIED
)

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния статуса заявки Π² пСсочницС

https://tinkoff.github.io/investAPI/sandbox/#getsandboxorderstate

# @account_id: String
# @order_id: String

sandbox_order_state account_id:, order_id:

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния списка Π°ΠΊΡ‚ΠΈΠ²Π½Ρ‹Ρ… заявок ΠΏΠΎ счёту Π² пСсочницС

https://tinkoff.github.io/investAPI/sandbox/#getsandboxorders

# @account_id: String

sandbox_orders account_id:

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния ΠΏΠΎΡ€Ρ‚Ρ„ΠΎΠ»ΠΈΠΎ Π² пСсочницС

https://tinkoff.github.io/investAPI/sandbox/#getsandboxportfolio

# @account_id: String

sandbox_portfolio account_id:

ΠœΠ΅Ρ‚ΠΎΠ΄ получСния ΠΏΠΎΠ·ΠΈΡ†ΠΈΠΉ ΠΏΠΎ Π²ΠΈΡ€Ρ‚ΡƒΠ°Π»ΡŒΠ½ΠΎΠΌΡƒ счёту пСсочницы

https://tinkoff.github.io/investAPI/sandbox/#getsandboxpositions

# @account_id: String

sandbox_positions account_id:

ΠœΠ΅Ρ‚ΠΎΠ΄ рСгистрации счёта Π² пСсочницС

https://tinkoff.github.io/investAPI/sandbox/#opensandboxaccount

open_sandbox_account

ΠœΠ΅Ρ‚ΠΎΠ΄ выставлСния Ρ‚ΠΎΡ€Π³ΠΎΠ²ΠΎΠ³ΠΎ поручСния Π² пСсочницС

https://tinkoff.github.io/investAPI/sandbox/#postsandboxorder

# @account_id: String
# @figi: String
# @quantity: Integer
# @price: Float
# @direction: InvestTinkoff::V2::OrderDirection
# @order_type: InvestTinkoff::V2::OrderType
# @order_id: String (max length 36)

create_sandbox_order(
  account_id:,
  figi:,
  quantity:,
  price:,
  direction:,
  order_type:,
  order_id:
)

ΠœΠ΅Ρ‚ΠΎΠ΄ пополнСния счёта Π² пСсочницС

https://tinkoff.github.io/investAPI/sandbox/#sandboxpayin

# @account_id: String
# @amount: Float
# @currency: String, ΠΏΡ€ΠΈΠΌΠ΅Ρ€ 'RUB', 'USD', 'EUR' ΠΈ Ρ‚.Π΄.

sandbox_pay_in account_id:, amount:, currency:

API v1

Deprecated

ВсС Π½ΠΎΠ²Ρ‹Π΅ Ρ€Π°Π±ΠΎΡ‡ΠΈΠ΅ Ρ‚ΠΎΠΊΠ΅Π½Ρ‹ доступны Ρ‚ΠΎΠ»ΡŒΠΊΠΎ для вСрсии V2. ΠŸΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° ΠΏΠ΅Ρ€Π²ΠΎΠΉ вСрсии Π±ΡƒΠ΄Π΅Ρ‚ Π·Π°Π²Π΅Ρ€ΡˆΠ΅Π½Π° Π² 2022 Π³ΠΎΠ΄Ρƒ.

client = InvestTinkoff::V1::SandboxClient.new token: 'ВАШ_Π’ΠžΠšΠ•Π'

ΠžΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΈ с заявками

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ списка Π°ΠΊΡ‚ΠΈΠ²Π½Ρ‹Ρ… заявок

orders

Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ Π»ΠΈΠΌΠΈΡ‚Π½ΠΎΠΉ заявки

orders_limit_order figi:, operation:, lots:, price:

Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ Ρ€Ρ‹Π½ΠΎΡ‡Π½ΠΎΠΉ заявки

orders_market_order figi:, operation:, lots:

ΠžΡ‚ΠΌΠ΅Π½Π° заявки

orders_cancel id

ΠžΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΈ с ΠΏΠΎΡ€Ρ‚Ρ„Π΅Π»Π΅ΠΌ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Ρ

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ портфСля ΠΊΠ»ΠΈΠ΅Π½Ρ‚Π°

portfolio

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ Π²Π°Π»ΡŽΡ‚Π½Ρ‹Ρ… Π°ΠΊΡ‚ΠΈΠ²ΠΎΠ² ΠΊΠ»ΠΈΠ΅Π½Ρ‚Π°

portfolio_currencies

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠΈ ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ ΠΏΠΎ Π±ΡƒΠΌΠ°Π³Π°ΠΌ

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ списка Π°ΠΊΡ†ΠΈΠΉ

market_stocks

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ списка ΠΎΠ±Π»ΠΈΠ³Π°Ρ†ΠΈΠΉ

market_bonds

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ списка ETF

market_etfs

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ списка Π²Π°Π»ΡŽΡ‚Π½Ρ‹Ρ… ΠΏΠ°Ρ€

market_currencies

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ стакана ΠΏΠΎ FIGI

market_orderbook figi:, depth: 20

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ историчСских свСчСй ΠΏΠΎ FIGI

market_candles figi:, from:, to:, interval:

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ инструмСнта ΠΏΠΎ FIGI

market_search_by_figi figi

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ инструмСнта ΠΏΠΎ Ρ‚ΠΈΠΊΠ΅Ρ€Ρƒ

market_search_by_ticker ticker

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠΈ ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ ΠΏΠΎ опСрациям

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ списка ΠΎΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΉ

operations from:, to:, figi: nil

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠΈ ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ ΠΏΠΎ брокСрским счСтам

ΠŸΠΎΠ»ΡƒΡ‡Π΅Π½ΠΈΠ΅ брокСрских счСтов ΠΊΠ»ΠΈΠ΅Π½Ρ‚Π°

user_accounts

API v1 Sandbox

ВсС ΠΎΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΈ Ρ€Π°Π±ΠΎΡ‡Π΅Π³ΠΎ ΠΊΠ»ΠΈΠ΅Π½Ρ‚Π° плюс:

client = InvestTinkoff::V1::SandboxClient.new token: 'ВАШ_Π’ΠžΠšΠ•Π_ΠŸΠ•Π‘ΠžΠ§ΠΠ˜Π¦Π«'

ΠžΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΈ Π² sandbox

Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ счСта ΠΈ выставлСниС баланса ΠΏΠΎ Π²Π°Π»ΡŽΡ‚Π½Ρ‹ΠΌ позициям

register

ВыставлСниС баланса ΠΏΠΎ Π²Π°Π»ΡŽΡ‚Π½Ρ‹ΠΌ позициям

currencies_balance currency:, balance:

ВыставлСниС баланса ΠΏΠΎ инструмСнтным позициям

position_balance figi:, balance:

Π£Π΄Π°Π»Π΅Π½ΠΈΠ΅ всСх ΠΏΠΎΠ·ΠΈΡ†ΠΈΠΉ ΠΊΠ»ΠΈΠ΅Π½Ρ‚Π°

clear

Π£Π΄Π°Π»Π΅Π½ΠΈΠ΅ счСта ΠΊΠ»ΠΈΠ΅Π½Ρ‚Π°

remove

About

Tinkoff Invest Ruby Rest API Gem

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages