tushare

package
v0.0.0-...-81b12a4 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	API_STOCK_BASIC    = "stock_basic"
	API_DAILY          = "daily"
	API_CONCEPT_DETAIL = "concept_detail"
	TS_CODE            = "ts_code"
	START_DATE         = "start_date"
	END_DATE           = "end_date"
)
View Source
const (
	STOCK_DAILY_TSCODE     = "ts_code"
	STOCK_DAILY_TRADE_DATE = "trade_date"
	STOCK_DAILY_OPEN       = "open"
	STOCK_DAILY_HIGH       = "high"
	STOCK_DAILY_LOW        = "low"
	STOCK_DAILY_CLOSE      = "close"
	STOCK_DAILY_PRE_CLOSE  = "pre_close"
	STOCK_DAILY_CHANGE     = "change"
	STOCK_DAILY_PCT_CHG    = "pct_chg"
	STOCK_DAILY_VOL        = "vol"
	STOCK_DAILY_AMOUNT     = "amount"
)

Variables

This section is empty.

Functions

func StockDailyHeaderIdx

func StockDailyHeaderIdx(headers []string) (
	headerTsCodeIdx,
	headerTradeDateiDx,
	headerOpenIdx,
	headerHighIdx,
	headerLowIdx,
	headerCloseIdx,
	headerPreCloseIdx,
	headerChangeIdx,
	headerPctChgIdx,
	headerVolIdx,
	headerAmountIdx int,
	err error)

StockDailyHeaderIdx ...

Types

type TuShare

type TuShare struct {
	URL   string
	Token string
}

TuShare ...

func New

func New() (t *TuShare, err error)

New ...

func (*TuShare) API

func (t *TuShare) API(req interface{}, resp interface{}) (err error)

API ...

func (*TuShare) Daily

func (t *TuShare) Daily(tsCodes []string, startDate time.Time, endDate time.Time) (resp TushareHttpResponse, err error)

Daily 数据说明:交易日每天15点~16点之间。本接口是未复权行情,停牌期间不提供数据。 调取说明:基础积分每分钟内最多调取500次,每次5000条数据,相当于23年历史,用户获得超过5000积分正常调取无频次限制。

func (*TuShare) StockBasic

func (t *TuShare) StockBasic() (resp TushareHttpResponse, err error)

StockBasic ...

type TushareData

type TushareData struct {
	Fields  []string        `json:"fields"`
	Items   [][]interface{} `json:"items"`
	HasMore bool            `json:"has_more"`
}

TushareData ...

type TushareHttpRequest

type TushareHttpRequest struct {
	APIName string            `json:"api_name"`
	Token   string            `json:"token"`
	Params  map[string]string `json:"params,omitempty"`
	Fields  string            `json:"fields,omitempty"`
}

TushareHttpRequest ... Reference: https://tushare.pro/document/1?doc_id=130

type TushareHttpResponse

type TushareHttpResponse struct {
	RequestID string      `json:"request_id"`
	Code      int         `json:"code"`
	Msg       string      `json:"mgs"`
	Data      TushareData `json:"data"`
}

StockBasicResponse ... Reference: https://tushare.pro/document/2?doc_id=25

Jump to

Keyboard shortcuts

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