history

package
v0.0.0-...-f7f5d23 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var POSITION_NOT_NEED_ORDERS alex.TargetPosition = (*order)(&order{})

Functions

func SetLogger

func SetLogger(logger *zap.Logger)

Types

type Candles

type Candles struct {
	// contains filtered or unexported fields
}

func NewCandles

func NewCandles(figi string, client *Client, instrument *instrument) *Candles

func (*Candles) GetFigi

func (c *Candles) GetFigi() string

func (*Candles) GetPeriod

func (c *Candles) GetPeriod() time.Duration

func (*Candles) GetSeries

func (c *Candles) GetSeries() *techan.TimeSeries

func (*Candles) Load

func (c *Candles) Load(ctx context.Context, from time.Time, to time.Time) error

func (*Candles) OnTick

func (c *Candles) OnTick(cc *techan.Candle)

func (*Candles) RemoveSubscriber

func (c *Candles) RemoveSubscriber(candleChan alex.CandleChan) bool

func (*Candles) Subscribe

func (c *Candles) Subscribe() (candleChan alex.CandleChan, err error)

func (*Candles) Unsubscribe

func (c *Candles) Unsubscribe(candleChan alex.CandleChan) error

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(dataDir string, from time.Time, to time.Time) *Client

func (*Client) CreateAccount

func (c *Client) CreateAccount(name string) alex.Account

func (*Client) GetInstrument

func (c *Client) GetInstrument(figi string) alex.Instrument

func (*Client) LoadData

func (c *Client) LoadData(figi string) (err error)

func (*Client) Now

func (c *Client) Now() time.Time

func (*Client) PrintResult

func (c *Client) PrintResult()

func (*Client) Printf

func (c *Client) Printf(format string, arg ...any) (n int, err error)

func (*Client) Run

func (c *Client) Run() error

Пробегаюсь по истории, для каждой свечи передаю в instrument.Tick 4 события: с ценой открытия, hi и low (меняя каждый шаг порядой, в котором передаю hi и low), и close

Jump to

Keyboard shortcuts

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