Package com.longbridge.fund
Class FundContext
- java.lang.Object
-
- com.longbridge.fund.FundContext
-
- All Implemented Interfaces:
AutoCloseable
public class FundContext extends Object implements AutoCloseable
Fund (mutual fund) channel context.
-
-
Constructor Summary
Constructors Constructor Description FundContext()
-
Method Summary
-
-
-
Method Detail
-
create
public static FundContext create(Config config)
Create a FundContext object.- Parameters:
config- Config object- Returns:
- A new FundContext instance
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
hotFunds
public CompletableFuture<HotFund[]> hotFunds() throws OpenApiException
Get the hot-selling fund list.- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
funds
public CompletableFuture<FundBrief[]> funds(GetFundsOptions opts) throws OpenApiException
Get the fund list.- Parameters:
opts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
filters
public CompletableFuture<FundFilters> filters() throws OpenApiException
Get the fund list filter options.- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
detail
public CompletableFuture<FundDetail> detail(String counterId) throws OpenApiException
Get fund detail.- Parameters:
counterId- Fund counter id- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
analysis
public CompletableFuture<FundAnalysis> analysis(String counterId, GetFundAnalysisOptions opts) throws OpenApiException
Get fund analysis (level 1).- Parameters:
counterId- Fund counter idopts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
analysisDetail
public CompletableFuture<FundAnalysisDetail> analysisDetail(String counterId, GetFundAnalysisOptions opts) throws OpenApiException
Get fund analysis detail (level 2).- Parameters:
counterId- Fund counter idopts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
trend
public CompletableFuture<FundTrend> trend(String counterId, GetFundAnalysisOptions opts) throws OpenApiException
Get fund trend chart.- Parameters:
counterId- Fund counter idopts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
annualReturns
public CompletableFuture<FundAnnualReturn[]> annualReturns(String counterId, FundPageOptions opts) throws OpenApiException
Get fund annual returns.- Parameters:
counterId- Fund counter idopts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
quarterlyReturns
public CompletableFuture<FundQuarterlyReturn[]> quarterlyReturns(String counterId, FundPageOptions opts) throws OpenApiException
Get fund quarterly returns.- Parameters:
counterId- Fund counter idopts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
performance
public CompletableFuture<FundPerformance[]> performance(String counterId) throws OpenApiException
Get fund performance figures.- Parameters:
counterId- Fund counter id- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
performanceComparison
public CompletableFuture<FundPerformanceComparison> performanceComparison(String counterId, GetFundAnalysisOptions opts) throws OpenApiException
Get fund performance comparison.- Parameters:
counterId- Fund counter idopts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
nav
public CompletableFuture<FundNavValue[]> nav(String counterId) throws OpenApiException
Get fund latest net value.- Parameters:
counterId- Fund counter id- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
navHistory
public CompletableFuture<FundNavValue[]> navHistory(String counterId, FundPageOptions opts) throws OpenApiException
Get fund historical net value (paged).- Parameters:
counterId- Fund counter idopts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
navRange
public CompletableFuture<FundNavValue[]> navRange(String counterId, FundNavRangeOptions opts) throws OpenApiException
Get fund historical net value by relative time range.- Parameters:
counterId- Fund counter idopts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
holdings
public CompletableFuture<FundHoldings> holdings(String counterId, GetFundHoldingsOptions opts) throws OpenApiException
Get a fund's top-10 holdings.- Parameters:
counterId- Fund counter idopts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
stockHoldings
public CompletableFuture<FundStockHolding[]> stockHoldings(String counterId, GetFundStockHoldingsOptions opts) throws OpenApiException
Get the stocks held by a fund (reverse lookup).- Parameters:
counterId- Fund counter idopts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
positions
public CompletableFuture<FundPositions> positions(GetFundPositionsOptions opts) throws OpenApiException
Get the user's fund positions overview.- Parameters:
opts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
position
public CompletableFuture<FundPositionDetail> position(String counterId, GetFundPositionOptions opts) throws OpenApiException
Get the user's single fund position detail.- Parameters:
counterId- Fund counter idopts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
positionPerformance
public CompletableFuture<FundPositionPerformance[]> positionPerformance(String counterId) throws OpenApiException
Get the performance figures of a held fund.- Parameters:
counterId- Fund counter id- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
positionProfits
public CompletableFuture<FundPositionProfits> positionProfits(String counterId, GetFundPositionProfitsOptions opts) throws OpenApiException
Get the cumulative-profit series of a held fund.- Parameters:
counterId- Fund counter idopts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
positionNav
public CompletableFuture<FundPositionNav[]> positionNav(String counterId, FundNavRangeOptions opts) throws OpenApiException
Get the net-value history of a held fund.- Parameters:
counterId- Fund counter idopts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
positionDividends
public CompletableFuture<FundDividends> positionDividends(String counterId, GetFundPositionDividendsOptions opts) throws OpenApiException
Get the dividend records of a held fund.- Parameters:
counterId- Fund counter idopts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
orders
public CompletableFuture<FundOrder[]> orders(GetFundOrdersOptions opts) throws OpenApiException
Get the user's fund orders.- Parameters:
opts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
order
public CompletableFuture<FundOrderDetail> order(long orderId) throws OpenApiException
Get a fund order detail.- Parameters:
orderId- Fund order id- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
transactions
public CompletableFuture<FundTransaction[]> transactions(GetFundTransactionsOptions opts) throws OpenApiException
Get the user's fund transactions (cash-flow records).- Parameters:
opts- Options for this request; may be null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
validateOrder
public CompletableFuture<FundOrderValidation> validateOrder(ValidateFundOrderOptions opts) throws OpenApiException
Validate a fund order before submitting.- Parameters:
opts- Options for this request, not null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
submitOrder
public CompletableFuture<FundOrderSubmitResponse> submitOrder(SubmitFundOrderOptions opts) throws OpenApiException
Submit a fund order (buy / sell).- Parameters:
opts- Options for this request, not null- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
cancelOrder
public CompletableFuture<Void> cancelOrder(long orderId) throws OpenApiException
Cancel (withdraw) a fund order.- Parameters:
orderId- Fund order id- Returns:
- A Future representing the result of the operation
- Throws:
OpenApiException- If an error occurs
-
-