fugle

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BestPrice

type BestPrice struct {
	Price  decimal.Decimal
	Volume int
}

type Chart added in v0.1.3

type Chart struct {
	O []decimal.Decimal
	H []decimal.Decimal
	I []decimal.Decimal
	C []decimal.Decimal
	V int
	T int
}

type Client

type Client struct {
	Host     string
	Version  string
	ApiToken string
}

func NewFugleClient

func NewFugleClient(opts ClientOption) (Client, error)

func (*Client) Chart

func (cli *Client) Chart(symbolID string, oddLot bool) (*Response, error)

func (*Client) Dealts

func (cli *Client) Dealts(symbolID string, oddLot bool, limit int64, offset int64) (*Response, error)

func (*Client) Meta

func (cli *Client) Meta(symbolID string, oddLot bool) (*Response, error)

func (*Client) Quote

func (cli *Client) Quote(symbolID string, oddLot bool) (*Response, error)

func (*Client) Volumes added in v0.2.0

func (cli *Client) Volumes(symbolID string, oddLot bool) (*Response, error)

type ClientOption

type ClientOption struct {
	Host     string
	Version  string
	ApiToken string
}

type Data added in v0.1.2

type Data struct {
	Info    Info
	Chart   Chart
	Quote   Quote
	Meta    Meta
	Dealts  []Dealt
	Volumes []BestPrice
}

type Dealt

type Dealt struct {
	At     time.Time
	Price  decimal.Decimal
	Bid    decimal.Decimal
	Ask    decimal.Decimal
	Volume int
	Serial int
}

type Info

type Info struct {
	Date          string
	Type          string
	Exchange      string
	Market        string
	SymbolID      string
	CountryCode   string
	Timezone      string
	LastUpdatedAt time.Time
}

type Meta

type Meta struct {
	NameZhTw        string
	Market          string
	IndustryZhTw    string
	PriceReference  decimal.Decimal
	PriceHighLimit  decimal.Decimal
	PriceLowLimit   decimal.Decimal
	TradingUnit     int
	CanDayBuySell   bool
	CanDaySellBuy   bool
	CanShortMargin  bool
	CanShortLend    bool
	Currency        string
	IsNewlyCompiled bool
	IsTerminated    bool
	IsSuspended     bool
	TypeZhTw        string
	Abnormal        string
}

type Quote

type Quote struct {
	IsCurbing      bool
	IsCurbingRise  bool
	IsCurbingFall  bool
	IsTrial        bool
	IsOpenDelayed  bool
	IsCloseDelayed bool
	IsHalting      bool
	IsClosed       bool
	Change         decimal.Decimal
	ChangePercent  float64
	Amplitude      float64
	Total          QuoteTotal
	Trial          QuoteTrial
	Trade          QuoteTrade
	Order          QuoteOrder
	PriceHigh      QuotePrice
	PriceLow       QuotePrice
	PriceOpen      QuotePrice
	PriceAvg       QuotePrice
	PriceLimit     int
}

type QuoteOrder

type QuoteOrder struct {
	At   time.Time
	Bids []BestPrice
	Asks []BestPrice
}

type QuotePrice

type QuotePrice struct {
	At    time.Time
	Price decimal.Decimal
}

type QuoteTotal

type QuoteTotal struct {
	At               time.Time
	Transaction      int
	TradeValue       decimal.Decimal
	TradeVolume      int
	TradeVolumeAtBid int
	TradeVolumeAtAsk int
	BidOrders        int
	AskOrders        int
	BidVolume        int
	AskVolume        int
	Serial           int
}

type QuoteTrade

type QuoteTrade struct {
	At     time.Time
	Price  decimal.Decimal
	Unit   int
	Volume int
	Serial int
}

type QuoteTrial

type QuoteTrial struct {
	At     time.Time
	Bid    decimal.Decimal
	Ask    decimal.Decimal
	Price  decimal.Decimal
	Volume int
}

type Response

type Response struct {
	APIVersion string
	StatusCode int
	Data       Data
}

Jump to

Keyboard shortcuts

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