Documentation ¶
Index ¶
Constants ¶
View Source
const QUANTITY = 1
QUANTITY - Кол-во лотов инструментов, которыми торгует бот
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct { StrategyConfig OrderBookStrategyConfig Client *investgo.Client // contains filtered or unexported fields }
func (*Bot) HandleOrderBooks ¶
HandleOrderBooks - нужно вызвать асинхронно, будет писать в канал id инструментов, которые нужно купить или продать
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor - Вызывается ботом и исполняет торговые поручения
func NewExecutor ¶
func NewExecutor(ctx context.Context, c *investgo.Client, ids map[string]Instrument, minProfit float64) *Executor
NewExecutor - Создание экземпляра исполнителя
type Instrument ¶
type Instrument struct {
// contains filtered or unexported fields
}
type LastPrices ¶
type LastPrices struct {
// contains filtered or unexported fields
}
LastPrices - Последние цены инструментов
func NewLastPrices ¶
func NewLastPrices() *LastPrices
func (*LastPrices) Get ¶
func (l *LastPrices) Get(id string) (float64, bool)
Get - получение последней цены
func (*LastPrices) Update ¶
func (l *LastPrices) Update(id string, price float64)
Update - обновление последних цен
type OrderBook ¶
type OrderBook struct { Figi string `json:"Figi"` InstrumentUid string `json:"InstrumentUid"` Depth int32 `json:"Depth"` IsConsistent bool `json:"IsConsistent"` TimeUnix int64 `json:"TimeUnix"` LimitUp float64 `json:"LimitUp"` LimitDown float64 `json:"LimitDown"` Bids []Order `json:"Bids"` Asks []Order `json:"Asks"` }
type OrderBookStrategyConfig ¶
type OrderBookStrategyConfig struct { // Instruments - слайс идентификаторов инструментов Instruments []string // Currency - ISO-код валюты инструментов Currency string // RequiredMoneyBalance - Минимальный баланс денежных средств в Currency для начала торгов. // Для песочницы пополнится автоматически. RequiredMoneyBalance float64 // Depth - Глубина стакана Depth int32 // Если кол-во бид/аск больше чем BuyRatio - покупаем BuyRatio float64 // Если кол-во аск/бид больше чем SellRatio - продаем SellRatio float64 // MinProfit - Минимальный процент выгоды, с которым можно совершать сделки MinProfit float64 // SellOut - Если true, то по достижению дедлайна бот выходит из всех активных позиций SellOut bool }
OrderBookStrategyConfig - Конфигурация стратегии на стакане
type Positions ¶
type Positions struct {
// contains filtered or unexported fields
}
Positions - Данные о позициях счета
func NewPositions ¶
func NewPositions() *Positions
func (*Positions) Update ¶
func (p *Positions) Update(data *pb.PositionData)
Update - Обновление позиций
Click to show internal directories.
Click to hide internal directories.