Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrderPlacer ¶
type OrderPlacer interface { SubscribeForOrderBookChanges(ctx context.Context, reqs []tinkoffinvest.OrderBookRequest) (<-chan tinkoffinvest.OrderBookChange, error) //nolint:lll GetOrderBook(ctx context.Context, req tinkoffinvest.OrderBookRequest) (*tinkoffinvest.OrderBookResponse, error) GetOrderState(ctx context.Context, _ tinkoffinvest.AccountID, _ tinkoffinvest.OrderID) (decimal.Decimal, error) CancelOrder(ctx context.Context, accountID tinkoffinvest.AccountID, orderID tinkoffinvest.OrderID) error PlaceLimitSellOrder(ctx context.Context, request tinkoffinvest.PlaceOrderRequest) (tinkoffinvest.OrderID, error) PlaceLimitBuyOrder(ctx context.Context, request tinkoffinvest.PlaceOrderRequest) (tinkoffinvest.OrderID, error) }
type Strategy ¶
type Strategy struct {
// contains filtered or unexported fields
}
Strategy consists in placing two counter orders at the spread border with their further adjustment.
func New ¶
func New( account tinkoffinvest.AccountID, ignoreInconsistent bool, minSpreadPercentage float64, figis []tinkoffinvest.FIGI, orderPlacer OrderPlacer, toolsCache ToolsCache, ) (*Strategy, error)
func (*Strategy) Apply ¶
func (s *Strategy) Apply(ctx context.Context, change tinkoffinvest.OrderBookChange) error
type ToolsCache ¶
type ToolsCache interface {
Get(ctx context.Context, figi tinkoffinvest.FIGI) (toolscache.Tool, error)
}
Click to show internal directories.
Click to hide internal directories.