Documentation ¶
Index ¶
- Variables
- func GetMd5HexStr(str string) string
- func HTTPGet(urlBase string, params map[string]string) (int, string, error)
- func HTTPGetBytes(urlBase string, params map[string]string) (int, []byte, error)
- func HTTPGetJSON(urlBase string, params map[string]string) (int, *simplejson.Json, error)
- func HTTPPost(urlBase string, params map[string]string) (int, string, error)
- func Login() (string, error)
- type PfBasic
- type PfReBalanceListPage
- type PfRebalanceHS
- type PfRebalanceParams
- type PfRebalanceStock
- type PfValueHS
- type PfValueListHS
- type PfValuesParams
- type StockBasic
- type StockKListParams
- type StockMinutesParams
- type StockPriceHS
- type StockPriceListHS
- type StockPriceMin
- type StockPriceMins
- type StockPriceRT
- type StockRT
Constants ¶
This section is empty.
Variables ¶
var XueqiuAccounts = map[string]string{}
XueqiuAccounts : xueqiu accounts
var XueqiuUrls = map[string]string{
"csrf": "https://xueqiu.com/service/csrf",
"login": "https://xueqiu.com/user/login",
"stock_rt": "https://xueqiu.com/v4/stock/quote.json",
"stock_k_list": "https://xueqiu.com/stock/forchartk/stocklist.json",
"stock_minutes": "https://xueqiu.com/stock/forchart/stocklist.json",
"stock_buysell": "https://xueqiu.com/stock/pankou.json",
"stocks_price": "https://xueqiu.com/stock/quotep.json",
"pf_daily": "https://xueqiu.com/cubes/nav_daily/all.json",
"pf_recommend": "https://xueqiu.com/cubes/discover/rank/cube/list.json?category=14",
"pf_rank_percent": "https://xueqiu.com/cubes/data/rank_percent.json",
"pf_rebalance": "https://xueqiu.com/cubes/rebalancing/history.json",
"pf_scores": "https://xueqiu.com/cubes/rank/summary.json",
}
XueqiuUrls : xueqiu urls map
Functions ¶
func HTTPGetBytes ¶
HTTPGetBytes : request using GET method, will encode the get params into url
func HTTPGetJSON ¶
HTTPGetJSON : request using GET method, will encode the get params into url
Types ¶
type PfBasic ¶
type PfBasic struct { Symbol string `json:"symbol"` Name string `json:"name"` // get from nav_daily Market string `json:"market"` ID int64 `json:"cube_id"` }
PfBasic : the basic info of a portfolio from serveral data source, get from pf_scores
func GetPfBasic ¶
GetPfBasic : get portfolio basic infomation
type PfReBalanceListPage ¶
type PfReBalanceListPage struct { Count int64 `json:"count"` Page int64 `json:"page"` TotalCount int64 `json:"totalCount"` PageList []PfRebalanceHS `json:"list"` MaxPage int64 `json:"maxPage"` }
PfReBalanceListPage : a page of rebalance records of a portfolio
func GetPfRebalanceListPage ¶
func GetPfRebalanceListPage(reqParams PfRebalanceParams) (*PfReBalanceListPage, error)
GetPfRebalanceListPage : get portfolio rebalance action list in history, paged
type PfRebalanceHS ¶
type PfRebalanceHS struct { Status string `json:"status"` //success, failed, canceled CashValue float64 `json:"cash_value"` RebalancingHistories []PfRebalanceStock `json:"rebalancing_histories"` UpdatedAt int64 `json:"updated_at"` }
PfRebalanceHS : an item of rebalance record of a portfolio
type PfRebalanceParams ¶
type PfRebalanceParams struct { CubeSymbol string Count int64 // count <= 50 Page int64 // from 1 to 20 }
PfRebalanceParams :
type PfRebalanceStock ¶
type PfRebalanceStock struct { StockName string `json:"stock_name"` StockSymbol string `json:"stock_symbol"` Weight float32 `json:"weight"` TargetWeight float32 `json:"target_weight"` Price float32 `json:"price"` UpdatedAt int64 `json:"updated_at"` }
PfRebalanceStock : a stock rebalancing of a record
type PfValueHS ¶
type PfValueHS struct { TimeStamp int64 `json:"time"` //DateStr string `json:"date"` Value float32 `json:"value"` Percent float32 `json:"percent"` }
PfValueHS : a net value item in a list of a portfolio
type PfValueListHS ¶
type PfValueListHS struct { Symbol string `json:"symbol"` Name string `json:"name"` ListHS []PfValueHS `json:"list"` }
PfValueListHS : the net values list of a portfolio
func GetPfValueListHS ¶
func GetPfValueListHS(reqParams PfValuesParams) (*PfValueListHS, error)
GetPfValueListHS : get portfolio value list in history
type PfValuesParams ¶
PfValuesParams :
type StockBasic ¶
type StockBasic struct { Symbol string `json:"symbol"` Exchange string `json:"exchange"` Code string `json:"code"` Name string `json:"name"` CurrencyUnit string `json:"currency_unit"` UpdateBasicAt uint64 `json:"updateAt"` }
StockBasic : basic info from real time info, all for indexes like SH000300
type StockKListParams ¶
type StockKListParams struct { Symbol string Period string FuquanType string Begin time.Time End time.Time }
StockKListParams :
type StockMinutesParams ¶
StockMinutesParams :
type StockPriceHS ¶
type StockPriceHS struct { Volume uint64 `json:"volume"` Turnrate float32 `json:"turnrate"` Open float32 `json:"open"` Close float32 `json:"close"` High float32 `json:"high"` Low float32 `json:"low"` Change float32 `json:"chg"` Percentage float32 `json:"percent"` MA5 float32 `json:"ma5"` MA10 float32 `json:"ma10"` MA20 float32 `json:"ma20"` MA30 float32 `json:"ma30"` MACD float32 `json:"macd"` DEA float32 `json:"dea"` DIF float32 `json:"dif"` Time string `json:"time"` }
StockPriceHS : Stock Price(K) in HiStory
type StockPriceListHS ¶
type StockPriceListHS struct { Success string `json:"success"` PriceListHS []StockPriceHS `json:"chartlist"` }
StockPriceListHS : contains K price list
func GetStockPriceListHS ¶
func GetStockPriceListHS(reqParams StockKListParams) (*StockPriceListHS, error)
GetStockPriceListHS : get stock price(K) list in history
type StockPriceMin ¶
type StockPriceMin struct { Volume uint64 `json:"volume"` AvgPrice float32 `json:"avg_price"` Current float32 `json:"current"` Time string `json:"time"` }
StockPriceMin : Stock Price(minutes in recent day) in HiStory
type StockPriceMins ¶
type StockPriceMins struct { Success string `json:"success"` PriceListMins []StockPriceMin `json:"chartlist"` }
StockPriceMins : contains the minute price list
func GetStockPriceMinutes ¶
func GetStockPriceMinutes(reqParams StockMinutesParams) (*StockPriceMins, error)
GetStockPriceMinutes : get stock price minutes list in a day
type StockPriceRT ¶
type StockPriceRT struct { Current float32 `json:"current"` Percentage float32 `json:"percentage"` Change float32 `json:"change"` Open float32 `json:"open"` Close float32 `json:"close"` LastClose float32 `json:"last_close"` High float32 `json:"high"` Low float32 `json:"low"` MarketCapital float32 `json:"marketCapital"` RiseStop float32 `json:"rise_stop"` FallStop float32 `json:"fall_stop"` Volume float32 `json:"volume"` PELYR float32 `json:"pe_lyr"` PETTM float32 `json:"pe_ttm"` EPS float32 `json:"eps"` PSR float32 `json:"psr"` PB float32 `json:"pb"` Divident float32 `json:"dividend"` UpdateAt uint64 `json:"updateAt"` }
StockPriceRT : real time price for now
type StockRT ¶
type StockRT struct { StockBasic StockPriceRT }
StockRT : Stock RealTime info
func GetStockRT ¶
GetStockRT : get stock current status