market

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Buy   bool
	Sell  bool
	Time  time.Time
	Cnt   int
	Price float64
}

type StepParamsDummy

type StepParamsDummy struct {
	Candles        smp.Candles
	OrderBook      *smp.OrderBook
	OrderBookNext  *smp.OrderBook
	InstrumentInfo *smp.InstrumentInfo
	Position       int

	Actions []Action
	// contains filtered or unexported fields
}

func (*StepParamsDummy) BuyByMarket

func (sp *StepParamsDummy) BuyByMarket(instrumentId string, ticker string, cnt int,
	meta *smp.MetaForOperations) (orderId string, err *mft.Error)

func (*StepParamsDummy) BuyByPrice

func (sp *StepParamsDummy) BuyByPrice(instrumentId string, ticker string, cnt int, price float64,
	meta *smp.MetaForOperations) (orderId string, err *mft.Error)

func (*StepParamsDummy) CancelBuyOrder

func (sp *StepParamsDummy) CancelBuyOrder(instrumentId string, ticker string, orderId string,
	meta *smp.MetaForOperations) (ok bool, err *mft.Error)

func (*StepParamsDummy) CancelSellOrder

func (sp *StepParamsDummy) CancelSellOrder(instrumentId string, ticker string, orderId string,
	meta *smp.MetaForOperations) (ok bool, err *mft.Error)

func (*StepParamsDummy) DoStep

func (sp *StepParamsDummy) DoStep() bool

func (*StepParamsDummy) GetCandles

func (sp *StepParamsDummy) GetCandles(instrumentId string, ticker string, dateFrom time.Time, dateTo time.Time) (cs smp.Candles, err *mft.Error)

func (*StepParamsDummy) GetInstrumentInfo

func (sp *StepParamsDummy) GetInstrumentInfo(instrumentId string, ticker string) (instrumentInfo *smp.InstrumentInfo, err *mft.Error)

func (*StepParamsDummy) GetOrderBook

func (sp *StepParamsDummy) GetOrderBook(instrumentId string, ticker string) (ob *smp.OrderBook, err *mft.Error)

func (*StepParamsDummy) SellByMarket

func (sp *StepParamsDummy) SellByMarket(instrumentId string, ticker string, cnt int,
	meta *smp.MetaForOperations) (orderId string, err *mft.Error)

func (*StepParamsDummy) SellByPrice

func (sp *StepParamsDummy) SellByPrice(instrumentId string, ticker string, cnt int, price float64,
	meta *smp.MetaForOperations) (orderId string, err *mft.Error)

func (*StepParamsDummy) StatusBuyOrder

func (sp *StepParamsDummy) StatusBuyOrder(instrumentId string, ticker string, orderId string,
	meta *smp.MetaForOperations) (status smp.StatusOrder, prices []smp.LotPrices, err *mft.Error)

func (*StepParamsDummy) StatusSellOrder

func (sp *StepParamsDummy) StatusSellOrder(instrumentId string, ticker string, orderId string,
	meta *smp.MetaForOperations) (status smp.StatusOrder, prices []smp.LotPrices, err *mft.Error)

type VirtualMarket

type VirtualMarket struct {
	Candles        smp.Candles
	OrderBook      *smp.OrderBook
	InstrumentInfo *smp.InstrumentInfo
	Position       int
}

func (*VirtualMarket) BuyByMarket

func (vm *VirtualMarket) BuyByMarket(instrumentId string, ticker string, cnt int,
	meta *smp.MetaForOperations) (orderId string, err *mft.Error)

func (*VirtualMarket) BuyByPrice

func (vm *VirtualMarket) BuyByPrice(instrumentId string, ticker string, cnt int, price float64,
	meta *smp.MetaForOperations) (orderId string, err *mft.Error)

func (*VirtualMarket) CancelBuyOrder

func (vm *VirtualMarket) CancelBuyOrder(instrumentId string, ticker string, orderId string,
	meta *smp.MetaForOperations) (ok bool, err *mft.Error)

func (*VirtualMarket) CancelSellOrder

func (vm *VirtualMarket) CancelSellOrder(instrumentId string, ticker string, orderId string,
	meta *smp.MetaForOperations) (ok bool, err *mft.Error)

func (*VirtualMarket) DoStep

func (vm *VirtualMarket) DoStep() bool

func (*VirtualMarket) GetCandles

func (vm *VirtualMarket) GetCandles(instrumentId string, ticker string, dateFrom time.Time, dateTo time.Time) (cs smp.Candles, err *mft.Error)

func (*VirtualMarket) GetInstrumentInfo

func (vm *VirtualMarket) GetInstrumentInfo(instrumentId string, ticker string) (instrumentInfo *smp.InstrumentInfo, err *mft.Error)

func (*VirtualMarket) GetOrderBook

func (vm *VirtualMarket) GetOrderBook(instrumentId string, ticker string) (ob *smp.OrderBook, err *mft.Error)

func (*VirtualMarket) SellByMarket

func (vm *VirtualMarket) SellByMarket(instrumentId string, ticker string, cnt int,
	meta *smp.MetaForOperations) (orderId string, err *mft.Error)

func (*VirtualMarket) SellByPrice

func (vm *VirtualMarket) SellByPrice(instrumentId string, ticker string, cnt int, price float64,
	meta *smp.MetaForOperations) (orderId string, err *mft.Error)

func (*VirtualMarket) StatusBuyOrder

func (vm *VirtualMarket) StatusBuyOrder(instrumentId string, ticker string, orderId string,
	meta *smp.MetaForOperations) (status smp.StatusOrder, prices []smp.LotPrices, err *mft.Error)

func (*VirtualMarket) StatusSellOrder

func (vm *VirtualMarket) StatusSellOrder(instrumentId string, ticker string, orderId string,
	meta *smp.MetaForOperations) (status smp.StatusOrder, prices []smp.LotPrices, err *mft.Error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL