Documentation ¶
Index ¶
- Constants
- type AccessLevel
- type AccountResponse
- type AccountStatus
- type AccountsResponse
- type CancelOrderRequest
- type CancelOrderResponse
- type Instrument
- type InstrumentIdType
- type InstrumentRequest
- type InstrumentResponse
- type LastPrice
- type LastPricesRequest
- type LastPricesResponse
- type MoneyValue
- type OrderDirection
- type OrderStage
- type OrderStateRequest
- type OrderStateResponse
- type OrderTrade
- type OrderTrades
- type OrderType
- type PositionsFuture
- type PositionsRequest
- type PositionsResponse
- type PositionsSecurity
- type PostOrderExcecStatus
- type PostOrderRequest
- type PostOrderResponse
- type RealExchange
- type SecurityTradingStatus
- type ShareResponse
- type SharesResponse
- type StreamCandleResponse
- type SubscribeCandlesRequest
Constants ¶
View Source
const ( AccountStatusUnspecified = 0 AccountStatusNew = 1 AccountStatusOpen = 2 AccountStatusClosed = 3 )
View Source
const ( AccountAccessLevelUnspecified = 0 AccountAccessLevelFullAccess = 1 AccountAccessLevelReadOnly = 2 AccountAccessLevelNoAccess = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessLevel ¶
type AccessLevel int
type AccountResponse ¶
type AccountResponse struct { Id string Type int Name string Status AccountStatus OpenedDate time.Time ClosedData time.Time AccessLevel AccessLevel }
type AccountStatus ¶
type AccountStatus int
func (AccountStatus) String ¶
func (s AccountStatus) String() string
type AccountsResponse ¶
type AccountsResponse struct {
Accounts []*AccountResponse
}
func AccountsResponseToDto ¶
func AccountsResponseToDto(resp *investapi.GetAccountsResponse) *AccountsResponse
func (*AccountsResponse) FindAccount ¶
func (ar *AccountsResponse) FindAccount(id string) (*AccountResponse, bool)
FindAccount simplifies search of account by id
type CancelOrderRequest ¶
func (*CancelOrderRequest) ToTinApi ¶
func (cor *CancelOrderRequest) ToTinApi() *investapi.CancelOrderRequest
type CancelOrderResponse ¶
func CancelOrderResponseToDto ¶
func CancelOrderResponseToDto(resp *investapi.CancelOrderResponse) *CancelOrderResponse
type Instrument ¶
type InstrumentIdType ¶
type InstrumentIdType int
const ( InstrumentIdUnspecified InstrumentIdType = iota InstrumentIdTypeFigi InstrumentIdTypeTicker InstrumentIdTypeUID )
type InstrumentRequest ¶
type InstrumentRequest struct { IdType InstrumentIdType ClassCode string Id string }
func (*InstrumentRequest) ToTinApi ¶
func (req *InstrumentRequest) ToTinApi() *investapi.InstrumentRequest
type InstrumentResponse ¶
type InstrumentResponse struct { Figi string Ticker string ClassCode string Isin string Lot int64 Currency string KLong decimal.Decimal KShort decimal.Decimal DLong decimal.Decimal DShort decimal.Decimal DLongMin decimal.Decimal DShortMin decimal.Decimal ShortEnabledFlag bool Name string Exchange string CountryOfRisk string CountryOfRiskName string InstrumentType string TradingStatus SecurityTradingStatus OtcFlag bool BuyAvailableFlag bool SellAvailableFlag bool MinPriceIncrement decimal.Decimal ApiTradeAvailableFlag bool Uid string RealExchange RealExchange }
func InstrumentResponseToDto ¶
func InstrumentResponseToDto(res *investapi.InstrumentResponse) *InstrumentResponse
func (*InstrumentResponse) IsTradingAvailable ¶
func (ir *InstrumentResponse) IsTradingAvailable() bool
type LastPricesRequest ¶
type LastPricesRequest struct {
Figis []string
}
func (*LastPricesRequest) ToTinApi ¶
func (req *LastPricesRequest) ToTinApi() *investapi.GetLastPricesRequest
type LastPricesResponse ¶
type LastPricesResponse struct {
LastPrices []*LastPrice
}
func LastPricesResponseToDto ¶
func LastPricesResponseToDto(resp *investapi.GetLastPricesResponse) *LastPricesResponse
func (*LastPricesResponse) GetByFigi ¶
func (lpr *LastPricesResponse) GetByFigi(figi string) *LastPrice
type MoneyValue ¶
func MoneyValueToDto ¶
func MoneyValueToDto(q *investapi.MoneyValue) *MoneyValue
func (*MoneyValue) ToTinApi ¶
func (mv *MoneyValue) ToTinApi() *investapi.MoneyValue
type OrderDirection ¶
type OrderDirection int
const ( OrderDirectionUnspecified OrderDirection = iota OrderDirectionBuy OrderDirectionSell )
type OrderStage ¶
type OrderStage struct { Price *MoneyValue Quantity int64 TradeId string }
func OrderStageToDto ¶
func OrderStageToDto(os *investapi.OrderStage) *OrderStage
type OrderStateRequest ¶
func (*OrderStateRequest) ToTinApi ¶
func (r *OrderStateRequest) ToTinApi() *investapi.GetOrderStateRequest
type OrderStateResponse ¶
type OrderStateResponse struct { OrderId string //Идентификатор заявки. Figi string LotsReq int64 //Lots requested LotsExec int64 //Lots executed ExecStatus PostOrderExcecStatus //Current order status. InitPrice *MoneyValue //Initial order price. Multiplication of requested lots quantity by price. ExecPrice *MoneyValue //Executed order price. Multiplication of average price by number of lots. TotalPrice *MoneyValue //Final order price with all commissions AvrPrice *MoneyValue //Average single position price. InitCommission *MoneyValue //Commission calculated at the order initiation ExecCommission *MoneyValue //Commission calculated by the order result Direction OrderDirection //Order direction InitSecurityPrice *MoneyValue //Initial price by one instrument Stages []*OrderStage //Stages of order execution ServiceCommission *MoneyValue //Service commission Currency string Type OrderType OrderDate time.Time //Order creation time }
func OrderStateResponseToDto ¶
func OrderStateResponseToDto(osr *investapi.OrderState) *OrderStateResponse
type OrderTrade ¶
type OrderTrades ¶
type OrderTrades struct { OrderId string CreatedAt time.Time Direction OrderDirection Figi string Trades []*OrderTrade AccountId string }
func OrderTradesToDto ¶
func OrderTradesToDto(resp *investapi.OrderTrades) *OrderTrades
type PositionsFuture ¶
type PositionsRequest ¶
type PositionsRequest struct {
AccountId string
}
func (*PositionsRequest) ToTinApi ¶
func (req *PositionsRequest) ToTinApi() *investapi.PositionsRequest
type PositionsResponse ¶
type PositionsResponse struct { Money []*MoneyValue Blocked []*MoneyValue Securities []*PositionsSecurity LimitsLoadingInProgress bool Futures []*PositionsFuture }
func PositionsResponseToDto ¶
func PositionsResponseToDto(resp *investapi.PositionsResponse) *PositionsResponse
func (*PositionsResponse) GetInstrument ¶
func (ps *PositionsResponse) GetInstrument(figi string) *PositionsSecurity
func (*PositionsResponse) GetMoney ¶
func (ps *PositionsResponse) GetMoney(currency string) *MoneyValue
type PositionsSecurity ¶
type PostOrderExcecStatus ¶
type PostOrderExcecStatus int
const ( ExecutionReportStatusUnspecified PostOrderExcecStatus = iota ExecutionReportStatusFill ExecutionReportStatusRejected ExecutionReportStatusCancelled ExecutionReportStatusNew ExecutionReportStatusPartiallyfill )
type PostOrderRequest ¶
type PostOrderRequest struct { Figi string PosNum int64 InstrPrice decimal.Decimal Direction OrderDirection AccountId string OrderType OrderType OrderId string }
func (*PostOrderRequest) ToTinApi ¶
func (pr *PostOrderRequest) ToTinApi() *investapi.PostOrderRequest
type PostOrderResponse ¶
type PostOrderResponse struct { OrderId string Figi string LotsReq int64 LotsExec int64 ExecStatus PostOrderExcecStatus InitPrice *MoneyValue ExecPrice *MoneyValue TotalPrice *MoneyValue InitCommission *MoneyValue ExecCommission *MoneyValue Aci *MoneyValue Direction OrderDirection Type OrderType Message string InitiOrdPrice decimal.Decimal }
func PostOrderResponseToDto ¶
func PostOrderResponseToDto(resp *investapi.PostOrderResponse) *PostOrderResponse
type RealExchange ¶
type RealExchange int
const ( RealExchangeUnspecified RealExchange = iota RealExchangeMoex //Moscow exchange RealExchangeRts //Saint-Petersburg exchange RealExchangeOtc //External instrument )
type SecurityTradingStatus ¶
type SecurityTradingStatus int
const ( SecurityTradingStatusUnspecified SecurityTradingStatus = iota //Undefined status SecurityTradingStatusNotAvailableForTrading //Not available for trading SecurityTradingStatusOpeningPeriod SecurityTradingStatusClosingPeriod SecurityTradingStatusBreakInTrading SecurityTradingStatusNormalTrading SecurityTradingStatusClosingAuction SecurityTradingStatusDarkPoolAuction SecurityTradingStatusDiscreteAuction SecurityTradingStatusOpeningAuctionPeriod SecurityTradingStatusTradingAtClosingAuctionPrice SecurityTradingStatusSessionAssigned SecurityTradingStatusSessionClose SecurityTradingStatusSessionOpen SecurityTradingStatusDealerNormalTrading SecurityTradingStatusDealerBreakInTrading SecurityTradingStatusDealerNotAvailableForTrading )
type ShareResponse ¶
type ShareResponse struct {}
type SharesResponse ¶
type SharesResponse struct {
}func SharesResponseToDto ¶
func SharesResponseToDto(res *investapi.SharesResponse) *SharesResponse
type StreamCandleResponse ¶
type StreamCandleResponse struct { Figi string Interval int Open decimal.Decimal High decimal.Decimal Low decimal.Decimal Close decimal.Decimal Volume int64 TimeStart time.Time TimeEnd time.Time }
func StreamCandleResponseToDto ¶
func StreamCandleResponseToDto(resp *investapi.Candle) *StreamCandleResponse
type SubscribeCandlesRequest ¶
type SubscribeCandlesRequest struct {
Instruments []Instrument
}
Source Files ¶
- accountsResponse.go
- cancelOrderRequest.go
- cancelOrderResponse.go
- instrumentRequest.go
- instrumentResponse.go
- lastPricesRequest.go
- lastPricesResponse.go
- orderStateRequest.go
- orderStateResponse.go
- orderTradesResponse.go
- positionsRequest.go
- positionsResponse.go
- postOrderRequest.go
- postOrderResponse.go
- sharesResponse.go
- subscribeCandlesRequest.go
- subscribeCandlesResponse.go
Click to show internal directories.
Click to hide internal directories.