models

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Depth

type Depth struct {
	Buy  [5]DepthItem `json:"buy"`
	Sell [5]DepthItem `json:"sell"`
}

Depth represents a group of buy/sell market depths.

type DepthItem

type DepthItem struct {
	Price    float64 `json:"price"`
	Quantity uint32  `json:"quantity"`
	Orders   uint32  `json:"orders"`
}

DepthItem represents a single market depth entry.

type OHLC

type OHLC struct {
	InstrumentToken uint32  `json:"-"`
	Open            float64 `json:"open"`
	High            float64 `json:"high"`
	Low             float64 `json:"low"`
	Close           float64 `json:"close"`
}

OHLC represents OHLC packets.

type Tick

type Tick struct {
	Mode            string
	InstrumentToken uint32
	IsTradable      bool
	IsIndex         bool

	// Timestamp represents Exchange timestamp
	Timestamp          Time
	LastTradeTime      Time
	LastPrice          float64
	LastTradedQuantity uint32
	TotalBuyQuantity   uint32
	TotalSellQuantity  uint32
	VolumeTraded       uint32
	TotalBuy           uint32
	TotalSell          uint32
	AverageTradePrice  float64
	OI                 uint32
	OIDayHigh          uint32
	OIDayLow           uint32
	NetChange          float64

	OHLC  OHLC
	Depth Depth
}

Tick represents a single packet in the market feed.

type Time

type Time struct {
	time.Time
}

Time is custom time format used in all responses

func (*Time) UnmarshalCSV

func (t *Time) UnmarshalCSV(s string) error

UnmarshalCSV converts CSV string field internal date

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

UnmarshalJSON parses JSON time string with custom time formats

Jump to

Keyboard shortcuts

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