Documentation
¶
Overview ¶
Package fund provides a client for the Longbridge fund (mutual fund) OpenAPI. It covers the fund catalog / market data (hot funds, fund list, filters, detail, analysis, trend, returns, performance, net value, holdings), the user's fund positions, and fund orders / trading.
The fund identifier is exposed as counter_id (e.g. UT/FD/HK0000384492). Because it contains "/" it cannot live in the URL path, so the single-fund endpoints target a fixed sub-path and carry the identifier as the counter_id query parameter.
Index ¶
- type FundAnalysis
- type FundAnalysisDetail
- type FundAnnualReturn
- type FundAssetAllocation
- type FundAssetAllocationItem
- type FundBrief
- type FundContext
- func (c *FundContext) Analysis(ctx context.Context, counterID string, params *GetFundAnalysis) (analysis *FundAnalysis, err error)
- func (c *FundContext) AnalysisDetail(ctx context.Context, counterID string, params *GetFundAnalysis) (detail *FundAnalysisDetail, err error)
- func (c *FundContext) AnnualReturns(ctx context.Context, counterID string, params *FundPage) (returns []*FundAnnualReturn, err error)
- func (c *FundContext) CancelOrder(ctx context.Context, orderId int64) (err error)
- func (c *FundContext) Detail(ctx context.Context, counterID string) (detail *FundDetail, err error)
- func (c *FundContext) Filters(ctx context.Context) (filters *FundFilters, err error)
- func (c *FundContext) Funds(ctx context.Context, params *GetFunds) (funds []*FundBrief, err error)
- func (c *FundContext) Holdings(ctx context.Context, counterID string, params *GetFundHoldings) (holdings *FundHoldings, err error)
- func (c *FundContext) HotFunds(ctx context.Context) (funds []*HotFund, err error)
- func (c *FundContext) Nav(ctx context.Context, counterID string) (nav []*FundNavValue, err error)
- func (c *FundContext) NavHistory(ctx context.Context, counterID string, params *FundPage) (nav []*FundNavValue, err error)
- func (c *FundContext) NavRange(ctx context.Context, counterID string, params *FundNavRange) (nav []*FundNavValue, err error)
- func (c *FundContext) Order(ctx context.Context, orderId int64) (detail *FundOrderDetail, err error)
- func (c *FundContext) Orders(ctx context.Context, params *GetFundOrders) (orders []*FundOrder, err error)
- func (c *FundContext) Performance(ctx context.Context, counterID string) (performance []*FundPerformance, err error)
- func (c *FundContext) PerformanceComparison(ctx context.Context, counterID string, params *GetFundAnalysis) (comparison *FundPerformanceComparison, err error)
- func (c *FundContext) Position(ctx context.Context, counterID string, params *GetFundPosition) (detail *FundPositionDetail, err error)
- func (c *FundContext) PositionDividends(ctx context.Context, counterID string, params *GetFundPositionDividends) (dividends *FundDividends, err error)
- func (c *FundContext) PositionNav(ctx context.Context, counterID string, params *FundNavRange) (nav []*FundPositionNav, err error)
- func (c *FundContext) PositionPerformance(ctx context.Context, counterID string) (performance []*FundPositionPerformance, err error)
- func (c *FundContext) PositionProfits(ctx context.Context, counterID string, params *GetFundPositionProfits) (profits *FundPositionProfits, err error)
- func (c *FundContext) Positions(ctx context.Context, params *GetFundPositions) (positions *FundPositions, err error)
- func (c *FundContext) QuarterlyReturns(ctx context.Context, counterID string, params *FundPage) (returns []*FundQuarterlyReturn, err error)
- func (c *FundContext) StockHoldings(ctx context.Context, counterID string, params *GetFundStockHoldings) (holdings []*FundStockHolding, err error)
- func (c *FundContext) SubmitOrder(ctx context.Context, params *SubmitFundOrder) (order *FundOrderSubmitResponse, err error)
- func (c *FundContext) Transactions(ctx context.Context, params *GetFundTransactions) (transactions []*FundTransaction, err error)
- func (c *FundContext) Trend(ctx context.Context, counterID string, params *GetFundAnalysis) (trend *FundTrend, err error)
- func (c *FundContext) ValidateOrder(ctx context.Context, params *ValidateFundOrder) (validation *FundOrderValidation, err error)
- type FundDatedValue
- type FundDetail
- type FundDividend
- type FundDividends
- type FundFilters
- type FundHolding
- type FundHoldings
- type FundNamedContrast
- type FundNavRange
- type FundNavValue
- type FundOrder
- type FundOrderDetail
- type FundOrderInfo
- type FundOrderKeyword
- type FundOrderStage
- type FundOrderSubmitResponse
- type FundOrderValidation
- type FundPage
- type FundPerformance
- type FundPerformanceComparison
- type FundPerformancePoint
- type FundPosition
- type FundPositionDetail
- type FundPositionDetailValues
- type FundPositionNav
- type FundPositionPerformance
- type FundPositionProfits
- type FundPositions
- type FundQuarterlyReturn
- type FundStockHolding
- type FundTransaction
- type FundTrend
- type FundTrendContrast
- type FundUnitValue
- type GetFundAnalysis
- type GetFundHoldings
- type GetFundOrders
- type GetFundPosition
- type GetFundPositionDividends
- type GetFundPositionProfits
- type GetFundPositions
- type GetFundStockHoldings
- type GetFundTransactions
- type GetFunds
- type HotFund
- type SubmitFundOrder
- type ValidateFundOrder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FundAnalysis ¶
type FundAnalysis struct {
ActualPeriod int32 `json:"actual_period"`
CostLevel json.RawMessage `json:"cost_level"`
ReturnAbility json.RawMessage `json:"return_ability"`
RiskAbility json.RawMessage `json:"risk_ability"`
UpdatedAt string `json:"updated_at"`
ValueForMoney json.RawMessage `json:"value_for_money"`
Visible bool `json:"visible"`
}
FundAnalysis is a fund analysis (level 1). The ability / cost fields are server-defined structures preserved as raw JSON.
type FundAnalysisDetail ¶
type FundAnalysisDetail struct {
ActualPeriod int32 `json:"actual_period"`
AvailablePeriods []int32 `json:"available_periods"`
CostLevel json.RawMessage `json:"cost_level"`
ReturnAbility json.RawMessage `json:"return_ability"`
RiskAbility json.RawMessage `json:"risk_ability"`
UpdatedAt string `json:"updated_at"`
ValueForMoney json.RawMessage `json:"value_for_money"`
Visible bool `json:"visible"`
}
FundAnalysisDetail is a fund analysis detail (level 2).
type FundAnnualReturn ¶
type FundAnnualReturn struct {
ChangePercent string `json:"change_percent"`
Year int32 `json:"year"`
}
FundAnnualReturn is a fund annual return entry.
type FundAssetAllocation ¶
type FundAssetAllocation struct {
AssetType int32 `json:"asset_type"`
Lists []*FundAssetAllocationItem `json:"lists"`
ReportDate string `json:"report_date"`
}
FundAssetAllocation is a fund's asset allocation.
type FundAssetAllocationItem ¶
type FundAssetAllocationItem struct {
Code string `json:"code"`
CounterId string `json:"counter_id"`
Name string `json:"name"`
PositionRatio string `json:"position_ratio"`
}
FundAssetAllocationItem is a single holding inside a fund's asset allocation.
type FundBrief ¶
type FundBrief struct {
AssetClass int32 `json:"asset_class"`
AssetClassName string `json:"asset_class_name"`
Code string `json:"code"`
CounterId string `json:"counter_id"`
Currency string `json:"currency"`
Description string `json:"description"`
EarningRate string `json:"earning_rate"`
Holding bool `json:"holding"`
Isin string `json:"isin"`
Name string `json:"name"`
Product string `json:"product"`
PurchaseAmount string `json:"purchase_amount"`
RecommendationTxt string `json:"recommendation_text"`
RiskLevel int32 `json:"risk_level"`
RiskLevelName string `json:"risk_level_name"`
TimeInterval string `json:"time_interval"`
UnitValue string `json:"unit_value"`
}
FundBrief is a fund entry in the fund list.
type FundContext ¶
type FundContext struct {
// contains filtered or unexported fields
}
FundContext is a client for the Longbridge fund (mutual fund) OpenAPI.
Example:
conf, err := config.NewFromEnv() fctx, err := fund.NewFromCfg(conf) funds, err := fctx.HotFunds(ctx)
func NewFromCfg ¶
func NewFromCfg(cfg *config.Config) (*FundContext, error)
NewFromCfg creates a FundContext from a *config.Config.
func NewFromEnv ¶
func NewFromEnv() (*FundContext, error)
NewFromEnv returns a FundContext configured from environment variables.
func (*FundContext) Analysis ¶
func (c *FundContext) Analysis(ctx context.Context, counterID string, params *GetFundAnalysis) (analysis *FundAnalysis, err error)
Analysis returns the fund analysis (level 1).
func (*FundContext) AnalysisDetail ¶
func (c *FundContext) AnalysisDetail(ctx context.Context, counterID string, params *GetFundAnalysis) (detail *FundAnalysisDetail, err error)
AnalysisDetail returns the fund analysis detail (level 2).
func (*FundContext) AnnualReturns ¶
func (c *FundContext) AnnualReturns(ctx context.Context, counterID string, params *FundPage) (returns []*FundAnnualReturn, err error)
AnnualReturns returns the fund annual returns.
func (*FundContext) CancelOrder ¶
func (c *FundContext) CancelOrder(ctx context.Context, orderId int64) (err error)
CancelOrder cancels (withdraws) a fund order.
func (*FundContext) Detail ¶
func (c *FundContext) Detail(ctx context.Context, counterID string) (detail *FundDetail, err error)
Detail returns the fund detail.
func (*FundContext) Filters ¶
func (c *FundContext) Filters(ctx context.Context) (filters *FundFilters, err error)
Filters returns the fund list filter options.
func (*FundContext) Holdings ¶
func (c *FundContext) Holdings(ctx context.Context, counterID string, params *GetFundHoldings) (holdings *FundHoldings, err error)
Holdings returns a fund's top-10 holdings.
func (*FundContext) HotFunds ¶
func (c *FundContext) HotFunds(ctx context.Context) (funds []*HotFund, err error)
HotFunds returns the hot-selling fund list.
func (*FundContext) Nav ¶
func (c *FundContext) Nav(ctx context.Context, counterID string) (nav []*FundNavValue, err error)
Nav returns the fund latest net value.
func (*FundContext) NavHistory ¶
func (c *FundContext) NavHistory(ctx context.Context, counterID string, params *FundPage) (nav []*FundNavValue, err error)
NavHistory returns the fund historical net value (paged).
func (*FundContext) NavRange ¶
func (c *FundContext) NavRange(ctx context.Context, counterID string, params *FundNavRange) (nav []*FundNavValue, err error)
NavRange returns the fund historical net value by relative time range.
func (*FundContext) Order ¶
func (c *FundContext) Order(ctx context.Context, orderId int64) (detail *FundOrderDetail, err error)
Order returns a fund order detail.
func (*FundContext) Orders ¶
func (c *FundContext) Orders(ctx context.Context, params *GetFundOrders) (orders []*FundOrder, err error)
Orders returns the user's fund orders (also serves as the trade / execution record).
func (*FundContext) Performance ¶
func (c *FundContext) Performance(ctx context.Context, counterID string) (performance []*FundPerformance, err error)
Performance returns the fund performance figures.
func (*FundContext) PerformanceComparison ¶
func (c *FundContext) PerformanceComparison(ctx context.Context, counterID string, params *GetFundAnalysis) (comparison *FundPerformanceComparison, err error)
PerformanceComparison returns the fund performance comparison.
func (*FundContext) Position ¶
func (c *FundContext) Position(ctx context.Context, counterID string, params *GetFundPosition) (detail *FundPositionDetail, err error)
Position returns the user's single fund position detail.
func (*FundContext) PositionDividends ¶
func (c *FundContext) PositionDividends(ctx context.Context, counterID string, params *GetFundPositionDividends) (dividends *FundDividends, err error)
PositionDividends returns the dividend records of a held fund.
func (*FundContext) PositionNav ¶
func (c *FundContext) PositionNav(ctx context.Context, counterID string, params *FundNavRange) (nav []*FundPositionNav, err error)
PositionNav returns the net-value history of a held fund.
func (*FundContext) PositionPerformance ¶
func (c *FundContext) PositionPerformance(ctx context.Context, counterID string) (performance []*FundPositionPerformance, err error)
PositionPerformance returns the performance figures of a held fund.
func (*FundContext) PositionProfits ¶
func (c *FundContext) PositionProfits(ctx context.Context, counterID string, params *GetFundPositionProfits) (profits *FundPositionProfits, err error)
PositionProfits returns the cumulative-profit series of a held fund.
func (*FundContext) Positions ¶
func (c *FundContext) Positions(ctx context.Context, params *GetFundPositions) (positions *FundPositions, err error)
Positions returns the user's fund positions overview.
func (*FundContext) QuarterlyReturns ¶
func (c *FundContext) QuarterlyReturns(ctx context.Context, counterID string, params *FundPage) (returns []*FundQuarterlyReturn, err error)
QuarterlyReturns returns the fund quarterly returns.
func (*FundContext) StockHoldings ¶
func (c *FundContext) StockHoldings(ctx context.Context, counterID string, params *GetFundStockHoldings) (holdings []*FundStockHolding, err error)
StockHoldings returns the stocks held by a fund (reverse lookup).
func (*FundContext) SubmitOrder ¶
func (c *FundContext) SubmitOrder(ctx context.Context, params *SubmitFundOrder) (order *FundOrderSubmitResponse, err error)
SubmitOrder submits a fund order (buy / sell).
func (*FundContext) Transactions ¶
func (c *FundContext) Transactions(ctx context.Context, params *GetFundTransactions) (transactions []*FundTransaction, err error)
Transactions returns the user's fund transactions (cash-flow records).
func (*FundContext) Trend ¶
func (c *FundContext) Trend(ctx context.Context, counterID string, params *GetFundAnalysis) (trend *FundTrend, err error)
Trend returns the fund trend chart.
func (*FundContext) ValidateOrder ¶
func (c *FundContext) ValidateOrder(ctx context.Context, params *ValidateFundOrder) (validation *FundOrderValidation, err error)
ValidateOrder validates a fund order before submitting.
type FundDatedValue ¶
FundDatedValue is a dated value point.
type FundDetail ¶
type FundDetail struct {
AdditionalPurchaseAmount string `json:"additional_purchase_amount"`
AffirmDay int32 `json:"affirm_day"`
AmountAffirmDay string `json:"amount_affirm_day"`
AssetAllocation *FundAssetAllocation `json:"asset_allocation"`
AssetClass int32 `json:"asset_class"`
AssetClassName string `json:"asset_class_name"`
BillPurchaseRate string `json:"bill_purchase_rate"`
Channel string `json:"channel"`
ClosePeriod string `json:"close_period"`
Code string `json:"code"`
Currency string `json:"currency"`
CutOffTime string `json:"cut_off_time"`
Derivatives bool `json:"derivatives"`
DoneDay int32 `json:"done_day"`
ExcessReturnFee string `json:"excess_return_fee"`
GstRate string `json:"gst_rate"`
Introduce string `json:"introduce"`
IsCashPlus bool `json:"is_cash_plus"`
IsComplex bool `json:"is_complex"`
IsNewCashPlus bool `json:"is_new_cash_plus"`
IsYinghebao bool `json:"is_yinghebao"`
Isin string `json:"isin"`
ManageRate string `json:"manage_rate"`
Manager string `json:"manager"`
MinHoldCash string `json:"min_hold_cash"`
MonthRaiseDay string `json:"month_raise_day"`
Name string `json:"name"`
NoLoad bool `json:"no_load"`
OpenDate string `json:"open_date"`
OpenPeriod string `json:"open_period"`
Product string `json:"product"`
ProductInformationLocals string `json:"product_information_locals"`
Profile string `json:"profile"`
Purchasable int32 `json:"purchasable"`
PurchaseAffirmDay string `json:"purchase_affirm_day"`
PurchaseAmount string `json:"purchase_amount"`
PurchaseRate string `json:"purchase_rate"`
Rating int32 `json:"rating"`
Redeemable int32 `json:"redeemable"`
RedemptionAdvanceDay string `json:"redemption_advance_day"`
RedemptionAmount string `json:"redemption_amount"`
RedemptionClosePeriodShows string `json:"redemption_close_period_shows"`
RedemptionDoneDay string `json:"redemption_done_day"`
RedemptionOpenDayShows string `json:"redemption_open_day_shows"`
RiskLevel int32 `json:"risk_level"`
RiskLevelName string `json:"risk_level_name"`
VerifyStatus int32 `json:"verify_status"`
VirtualCurrency bool `json:"virtual_currency"`
YearToDateYield string `json:"year_to_date_yield"`
YtdYieldType int32 `json:"ytd_yield_type"`
}
FundDetail is a fund detail.
type FundDividend ¶
type FundDividend struct {
Amount string `json:"amount"`
CounterId string `json:"counter_id"`
Currency string `json:"currency"`
Date int64 `json:"date"`
DivMethod string `json:"div_method"`
Name string `json:"name"`
}
FundDividend is a cash dividend record for a held fund.
type FundDividends ¶
type FundDividends struct {
Currency string `json:"currency"`
DivCashInfos []*FundDividend `json:"div_cash_infos"`
LastestDate int64 `json:"lastest_date"`
TotalDivCash string `json:"total_div_cash"`
}
FundDividends is the user's dividend records for a held fund.
type FundFilters ¶
type FundFilters struct {
AssetClass []json.RawMessage `json:"asset_class"`
Company []json.RawMessage `json:"company"`
Currency []json.RawMessage `json:"currency"`
IndustryCategoryName []json.RawMessage `json:"industry_category_name"`
RiskLevel []json.RawMessage `json:"risk_level"`
}
FundFilters is the fund list filter options. Each list holds server-defined option objects preserved as raw JSON.
type FundHolding ¶
type FundHolding struct {
BondType string `json:"bond_type"`
BondTypeName string `json:"bond_type_name"`
CountryName string `json:"country_name"`
HoldingType string `json:"holding_type"`
IndustryName string `json:"industry_name"`
MarketValue string `json:"market_value"`
MaturityDate string `json:"maturity_date"`
Name string `json:"name"`
Weighting string `json:"weighting"`
}
FundHolding is a single fund holding (top-10 holdings).
type FundHoldings ¶
type FundHoldings struct {
Holdings []*FundHolding `json:"holdings"`
ReportDate string `json:"report_date"`
Weighting string `json:"weighting"`
}
FundHoldings is a fund's top-10 holdings.
type FundNamedContrast ¶
type FundNamedContrast struct {
Name string `json:"name"`
Performances []json.RawMessage `json:"performances"`
}
FundNamedContrast is a named contrast performance series.
type FundNavRange ¶
type FundNavRange struct {
}
FundNavRange is a net-value range option (relative months / years before now).
func (*FundNavRange) Values ¶
func (r *FundNavRange) Values() url.Values
Values builds the query string for a net-value range endpoint.
type FundNavValue ¶
type FundNavValue struct {
}
FundNavValue is a fund net-asset-value data point (latest / historical).
type FundOrder ¶
type FundOrder struct {
Action string `json:"action"`
Amount string `json:"amount"`
CounterId string `json:"counter_id"`
CreatedAt int64 `json:"created_at"`
Currency string `json:"currency"`
FundName string `json:"fund_name"`
Id int64 `json:"id"`
IsAuto bool `json:"is_auto"`
NetWorth string `json:"net_worth"`
ProductType string `json:"product_type"`
State string `json:"state"`
StateDesc string `json:"state_desc"`
Units string `json:"units"`
}
FundOrder is a fund order (list view).
type FundOrderDetail ¶
type FundOrderDetail struct {
Keywords []*FundOrderKeyword `json:"keywords"`
Order *FundOrderInfo `json:"order"`
Stages []*FundOrderStage `json:"stages"`
}
FundOrderDetail is a fund order detail.
type FundOrderInfo ¶
type FundOrderInfo struct {
Aaid int64 `json:"aaid"`
AccountChannel string `json:"account_channel"`
Action string `json:"action"`
Amount string `json:"amount"`
Channel string `json:"channel"`
CounterId string `json:"counter_id"`
CreatedAt int64 `json:"created_at"`
Currency string `json:"currency"`
DividendOption string `json:"dividend_option"`
EqAt int64 `json:"eq_at"`
Fee string `json:"fee"`
FundName string `json:"fund_name"`
FundSource string `json:"fund_source"`
Histories string `json:"histories"`
Id int64 `json:"id"`
Message string `json:"message"`
NetWorth string `json:"net_worth"`
PriceAt int64 `json:"price_at"`
ProcessedAt int64 `json:"processed_at"`
ProductType string `json:"product_type"`
Repurchaseable bool `json:"repurchaseable"`
SaleProceeds string `json:"sale_proceeds"`
SalesCharge string `json:"sales_charge"`
SalesPrice string `json:"sales_price"`
SalesUnit string `json:"sales_unit"`
State string `json:"state"`
StateDesc string `json:"state_desc"`
Status int32 `json:"status"`
StatusEx int32 `json:"status_ex"`
TDescription string `json:"t_description"`
TimePartition string `json:"time_partition"`
TotalAmount string `json:"total_amount"`
TransactionAt int64 `json:"transaction_at"`
Units string `json:"units"`
WithdrawAt int64 `json:"withdraw_at"`
Withdrawable bool `json:"withdrawable"`
}
FundOrderInfo is the full information of a fund order.
type FundOrderKeyword ¶
type FundOrderKeyword struct {
Content string `json:"content"`
Group string `json:"group"`
Key string `json:"key"`
LineStrategy string `json:"line_strategy"`
Title string `json:"title"`
}
FundOrderKeyword is a keyword block in a fund order detail.
type FundOrderStage ¶
type FundOrderStage struct {
Desc string `json:"desc"`
Key string `json:"key"`
Link string `json:"link"`
LinkText string `json:"link_text"`
Progress string `json:"progress"`
Stage string `json:"stage"`
}
FundOrderStage is a processing stage in a fund order detail.
type FundOrderSubmitResponse ¶
type FundOrderSubmitResponse struct {
Action string `json:"action"`
Amount string `json:"amount"`
CounterId string `json:"counter_id"`
CreatedAt int64 `json:"created_at"`
FundName string `json:"fund_name"`
Id int64 `json:"id"`
Msg string `json:"msg"`
Status int32 `json:"status"`
Units string `json:"units"`
}
FundOrderSubmitResponse is the result of submitting a fund order.
type FundOrderValidation ¶
type FundOrderValidation struct {
AuthToken string `json:"auth_token"`
EvalAddress string `json:"eval_address"`
FundRiskLevel int32 `json:"fund_risk_level"`
Msg string `json:"msg"`
UserPi int32 `json:"user_pi"`
UserRiskLevel int32 `json:"user_risk_level"`
}
FundOrderValidation is the result of validating a fund order.
type FundPerformance ¶
type FundPerformance struct {
AnnualizedReturnFive string `json:"annualized_return_five"`
AnnualizedReturnOne string `json:"annualized_return_one"`
AnnualizedReturnTen string `json:"annualized_return_ten"`
AnnualizedReturnThree string `json:"annualized_return_three"`
AnnualizedReturnTwo string `json:"annualized_return_two"`
CounterId string `json:"counter_id"`
FundName string `json:"fund_name"`
PerformanceRankFiveYears int32 `json:"performance_rank_five_years"`
PerformanceRankOneDay int32 `json:"performance_rank_one_day"`
PerformanceRankOneMonth int32 `json:"performance_rank_one_month"`
PerformanceRankOneWeek int32 `json:"performance_rank_one_week"`
PerformanceRankOneYear int32 `json:"performance_rank_one_year"`
PerformanceRankSixMonths int32 `json:"performance_rank_six_months"`
PerformanceRankTenYears int32 `json:"performance_rank_ten_years"`
PerformanceRankThreeMonths int32 `json:"performance_rank_three_months"`
PerformanceRankThreeYears int32 `json:"performance_rank_three_years"`
PerformanceRankTwoYears int32 `json:"performance_rank_two_years"`
PerformanceRankYtd int32 `json:"performance_rank_ytd"`
PerformanceReturnFiveYears string `json:"performance_return_five_years"`
PerformanceReturnOneDay string `json:"performance_return_one_day"`
PerformanceReturnOneMonth string `json:"performance_return_one_month"`
PerformanceReturnOneWeek string `json:"performance_return_one_week"`
PerformanceReturnOneYear string `json:"performance_return_one_year"`
PerformanceReturnSixMonths string `json:"performance_return_six_months"`
PerformanceReturnTenYears string `json:"performance_return_ten_years"`
PerformanceReturnThreeMonths string `json:"performance_return_three_months"`
PerformanceReturnThreeYears string `json:"performance_return_three_years"`
PerformanceReturnTwoYears string `json:"performance_return_two_years"`
PerformanceReturnYtd string `json:"performance_return_ytd"`
PerformanceTotalFiveYears int32 `json:"performance_total_five_years"`
PerformanceTotalOneDay int32 `json:"performance_total_one_day"`
PerformanceTotalOneMonth int32 `json:"performance_total_one_month"`
PerformanceTotalOneWeek int32 `json:"performance_total_one_week"`
PerformanceTotalOneYear int32 `json:"performance_total_one_year"`
PerformanceTotalSixMonths int32 `json:"performance_total_six_months"`
PerformanceTotalTenYears int32 `json:"performance_total_ten_years"`
PerformanceTotalThreeMonths int32 `json:"performance_total_three_months"`
PerformanceTotalThreeYears int32 `json:"performance_total_three_years"`
PerformanceTotalTwoYears int32 `json:"performance_total_two_years"`
PerformanceTotalYtd int32 `json:"performance_total_ytd"`
SevenDaysAnnualized string `json:"seven_days_annualized"`
TenThousandPrice string `json:"ten_thousand_price"`
UpdateTime int64 `json:"update_time"`
}
FundPerformance is a fund's detailed performance figures.
type FundPerformanceComparison ¶
type FundPerformanceComparison struct {
ContrastPerformances []*FundNamedContrast `json:"contrast_performances"`
FundPerformances []json.RawMessage `json:"fund_performances"`
}
FundPerformanceComparison is a fund performance comparison.
type FundPerformancePoint ¶
FundPerformancePoint is a recent performance point used by the hot-fund list.
type FundPosition ¶
type FundPosition struct {
Amount string `json:"amount"`
CounterId string `json:"counter_id"`
Currency string `json:"currency"`
FreezeUnits string `json:"freeze_units"`
HoldingProfit string `json:"holding_profit"`
HoldingUnits string `json:"holding_units"`
Name string `json:"name"`
RecentProfit string `json:"recent_profit"`
RecentTradingDay int64 `json:"recent_trading_day"`
SumRecentProfit string `json:"sum_recent_profit"`
}
FundPosition is a single fund position held by the user.
type FundPositionDetail ¶
type FundPositionDetail struct {
DetailValues *FundPositionDetailValues `json:"detail_values"`
SumProfit []*FundDatedValue `json:"sum_profit"`
UtValue []*FundUnitValue `json:"ut_value"`
}
FundPositionDetail is the detail of a single fund position.
type FundPositionDetailValues ¶
type FundPositionDetailValues struct {
Amount string `json:"amount"`
Currency string `json:"currency"`
HoldingCost string `json:"holding_cost"`
HoldingProfit string `json:"holding_profit"`
HoldingProfitRate string `json:"holding_profit_rate"`
HoldingUnits string `json:"holding_units"`
HoldingValue string `json:"holding_value"`
PendingBuyValue string `json:"pending_buy_value"`
PendingSellValue string `json:"pending_sell_value"`
ProfitAmountAccumTd string `json:"profit_amount_accum_td"`
ProfitAmountAccumTdRate string `json:"profit_amount_accum_td_rate"`
RecentProfit string `json:"recent_profit"`
RecentTradingday int64 `json:"recent_tradingday"`
RecentUnitValue string `json:"recent_unit_value"`
SoldPendingConfirmUnits string `json:"sold_pending_confirm_units"`
}
FundPositionDetailValues holds the detail values of a single fund position.
type FundPositionNav ¶
type FundPositionNav struct {
}
FundPositionNav is a held-fund net-value point (position view).
type FundPositionPerformance ¶
type FundPositionPerformance struct {
AnnualizedReturnFive string `json:"annualized_return_five"`
AnnualizedReturnOne string `json:"annualized_return_one"`
AnnualizedReturnTen string `json:"annualized_return_ten"`
AnnualizedReturnThree string `json:"annualized_return_three"`
AnnualizedReturnTwo string `json:"annualized_return_two"`
CounterId string `json:"counter_id"`
FundName string `json:"fund_name"`
PerformanceReturnFiveYears string `json:"performance_return_five_years"`
PerformanceReturnOneDay string `json:"performance_return_one_day"`
PerformanceReturnOneMonth string `json:"performance_return_one_month"`
PerformanceReturnOneWeek string `json:"performance_return_one_week"`
PerformanceReturnOneYear string `json:"performance_return_one_year"`
PerformanceReturnSixMonths string `json:"performance_return_six_months"`
PerformanceReturnTenYears string `json:"performance_return_ten_years"`
PerformanceReturnThreeMonths string `json:"performance_return_three_months"`
PerformanceReturnThreeYears string `json:"performance_return_three_years"`
PerformanceReturnTwoYears string `json:"performance_return_two_years"`
PerformanceReturnYtd string `json:"performance_return_ytd"`
UpdateTime int64 `json:"update_time"`
}
FundPositionPerformance holds the performance figures for a held fund.
type FundPositionProfits ¶
type FundPositionProfits struct {
Currency string `json:"currency"`
HistoryValue []*FundDatedValue `json:"history_value"`
LastUpdateTime int64 `json:"last_update_time"`
SumProfit string `json:"sum_profit"`
}
FundPositionProfits is the user's cumulative profit for a held fund.
type FundPositions ¶
type FundPositions struct {
AccountChannel string `json:"account_channel"`
List []*FundPosition `json:"list"`
PendingBuyOrders string `json:"pending_buy_orders"`
RecentTradingDay int64 `json:"recent_trading_day"`
SoldPendingCreditOrders string `json:"sold_pending_credit_orders"`
}
FundPositions is the user's fund positions overview.
type FundQuarterlyReturn ¶
type FundQuarterlyReturn struct {
ChangePercent string `json:"change_percent"`
Quarter int32 `json:"quarter"`
Year int32 `json:"year"`
}
FundQuarterlyReturn is a fund quarterly return entry.
type FundStockHolding ¶
type FundStockHolding struct {
Code string `json:"code"`
CounterId string `json:"counter_id"`
Currency string `json:"currency"`
Name string `json:"name"`
PositionRatio string `json:"position_ratio"`
ReportDate string `json:"report_date"`
}
FundStockHolding is a stock held by the fund (reverse lookup).
type FundTransaction ¶
type FundTransaction struct {
Amount string `json:"amount"`
Category string `json:"category"`
CreatedAt int64 `json:"created_at"`
Currency string `json:"currency"`
Description string `json:"description"`
DetailCreatedAt int64 `json:"detail_created_at"`
DetailType string `json:"detail_type"`
DoneAt int64 `json:"done_at"`
QuantityDescription string `json:"quantity_description"`
RedirectPage string `json:"redirect_page"`
RedirectPageV2 string `json:"redirect_page_v2"`
RefNo string `json:"ref_no"`
StockQuantity string `json:"stock_quantity"`
TxType string `json:"tx_type"`
TypeName string `json:"type_name"`
}
FundTransaction is a fund transaction / cash-flow record.
type FundTrend ¶
type FundTrend struct {
ActualPeriod int32 `json:"actual_period"`
AvailablePeriods []int32 `json:"available_periods"`
CategoryAveragePerformances []json.RawMessage `json:"category_average_performances"`
ContrastPerformances *FundTrendContrast `json:"contrast_performances"`
FundPerformances []json.RawMessage `json:"fund_performances"`
}
FundTrend is a fund trend chart.
type FundTrendContrast ¶
type FundTrendContrast struct {
BenchmarkName string `json:"benchmark_name"`
Performances []json.RawMessage `json:"performances"`
}
FundTrendContrast is a benchmark contrast series in a fund trend chart.
type FundUnitValue ¶
type FundUnitValue struct {
Date int64 `json:"date"`
DayIncreaseRate string `json:"day_increase_rate"`
TotalValue string `json:"total_value"`
UnitValue string `json:"unit_value"`
}
FundUnitValue is a fund unit-value point (position view).
type GetFundAnalysis ¶
type GetFundAnalysis struct {
Period int32 // optional, analysis period (0 = omit)
}
GetFundAnalysis is the request for the fund analysis / trend / comparison endpoints.
func (*GetFundAnalysis) Values ¶
func (r *GetFundAnalysis) Values() url.Values
Values builds the query string for the fund analysis / trend / comparison endpoints.
type GetFundHoldings ¶
type GetFundHoldings struct {
Scene int32 // optional
}
GetFundHoldings is the request for the fund holdings endpoint.
func (*GetFundHoldings) Values ¶
func (r *GetFundHoldings) Values() url.Values
Values builds the query string for the fund holdings endpoint.
type GetFundOrders ¶
type GetFundOrders struct {
CounterIDs []string // optional, filter by fund counter_ids (query key "counter_id")
Actions string // optional, comma-separated actions
States string // optional, comma-separated states
Currency string // optional
Start int64 // optional, range start (unix seconds)
End int64 // optional, range end (unix seconds)
Page int32 // optional
Size int32 // optional
}
GetFundOrders is the request for the fund orders list.
func (*GetFundOrders) Values ¶
func (r *GetFundOrders) Values() url.Values
Values builds the query string for the fund orders list.
type GetFundPosition ¶
type GetFundPosition struct {
AccountChannel string // optional
Aaid int64 // optional, account id
Start string // optional, range start
End string // optional, range end
}
GetFundPosition is the request for a single fund position detail.
func (*GetFundPosition) Values ¶
func (r *GetFundPosition) Values() url.Values
Values builds the query string for a single fund position detail.
type GetFundPositionDividends ¶
type GetFundPositionDividends struct {
AccountChannel string // optional
Aaid int64 // optional, account id
Currency string // optional
Start int64 // optional, range start (unix seconds)
End int64 // optional, range end (unix seconds)
Page int32 // optional
Size int32 // optional
}
GetFundPositionDividends is the request for a single fund position dividend list.
func (*GetFundPositionDividends) Values ¶
func (r *GetFundPositionDividends) Values() url.Values
Values builds the query string for a single fund position dividend list.
type GetFundPositionProfits ¶
type GetFundPositionProfits struct {
AccountChannel string // optional
Aaid int64 // optional, account id
Start string // optional, range start
End string // optional, range end
Page int32 // optional
Size int32 // optional
}
GetFundPositionProfits is the request for a single fund position cumulative-profit list.
func (*GetFundPositionProfits) Values ¶
func (r *GetFundPositionProfits) Values() url.Values
Values builds the query string for a single fund position profit list.
type GetFundPositions ¶
type GetFundPositions struct {
AccountChannel string // optional
Aaid int64 // optional, account id
}
GetFundPositions is the request for the fund positions overview endpoint.
func (*GetFundPositions) Values ¶
func (r *GetFundPositions) Values() url.Values
Values builds the query string for the fund positions overview endpoint.
type GetFundStockHoldings ¶
type GetFundStockHoldings struct {
Limit int32 // optional, maximum number of stocks to return
}
GetFundStockHoldings is the request for the fund stock-holdings (reverse) endpoint.
func (*GetFundStockHoldings) Values ¶
func (r *GetFundStockHoldings) Values() url.Values
Values builds the query string for the fund stock-holdings endpoint.
type GetFundTransactions ¶
type GetFundTransactions struct {
AccountChannel string // optional
BusinessType string // optional
Category string // optional
Currencies string // optional, comma-separated
Start int64 // optional, range start (unix seconds)
End int64 // optional, range end (unix seconds)
Page int32 // optional
Size int32 // optional
}
GetFundTransactions is the request for the fund transactions (cash-flow) list.
func (*GetFundTransactions) Values ¶
func (r *GetFundTransactions) Values() url.Values
Values builds the query string for the fund transactions list.
type GetFunds ¶
type GetFunds struct {
Filter json.RawMessage // optional, server-defined filter object
QuickIds []int64 // optional, quick-filter ids
TimeInterval []string // optional, earning-rate time intervals
}
GetFunds is the request for the fund list (POST /v1/fund/funds).
type HotFund ¶
type HotFund struct {
AssetClass int32 `json:"asset_class"`
AssetClassName string `json:"asset_class_name"`
CounterId string `json:"counter_id"`
Currency string `json:"currency"`
EarningRate string `json:"earning_rate"`
FundPerformances []*FundPerformancePoint `json:"fund_performances"`
Name string `json:"name"`
PurchaseAmount string `json:"purchase_amount"`
RecommendationTxt string `json:"recommendation_text"`
RiskLevel int32 `json:"risk_level"`
RiskLevelName string `json:"risk_level_name"`
TimeInterval string `json:"time_interval"`
}
HotFund is a hot-selling fund entry.
type SubmitFundOrder ¶
type SubmitFundOrder struct {
CounterID string // required, fund counter_id
Action string // required, buy / sell
Currency string // required
Amount string // optional, for amount-based orders
Units string // optional, for unit-based orders
DividendOption *int32 // optional
Fee string // optional
IsSellAll *bool // optional
Remark string // optional
TradeMethod *int32 // optional
}
SubmitFundOrder is the request for submitting a fund order (buy / sell). CounterID, Action and Currency are required; the remaining fields are optional (nil pointers are omitted).
type ValidateFundOrder ¶
type ValidateFundOrder struct {
CounterID string // required, fund counter_id
Action string // required, buy / sell
Currency string // required
Amount string // optional, for amount-based orders
Units string // optional, for unit-based orders
DividendOption *int32 // optional
FundSource *int32 // optional
AccountChannel string // optional
}
ValidateFundOrder is the request for validating a fund order before submitting. CounterID, Action and Currency are required; the remaining fields are optional (nil pointers are omitted).