Skip to main content

Candles

Retrieve a mutual fund's NAV (net asset value) OHLC series.

Making Requests

Use the candles() method on the funds resource, built with FundCandlesRequest. Funds report NAV, not traded volume, so there is no volume column, and only daily-and-coarser resolutions are available (no intraday).

FundCandlesResponse candles(FundCandlesRequest request)
CompletableFuture<FundCandlesResponse> candlesAsync(FundCandlesRequest request)

FundCandlesRequest

FundCandlesRequest.of(FundResolution resolution, String symbol)
FundCandlesRequest.builder(FundResolution resolution, String symbol)
.date(LocalDate date) // a single day
.from(LocalDate from) // window start (inclusive)
.to(LocalDate to) // window end (exclusive)
.countback(int n) // N candles before `to`
.build()

FundResolution

A value type for the candle interval — daily and coarser only:

FundResolution.DAILY     // also WEEKLY, MONTHLY, YEARLY
FundResolution.days(1)
FundResolution.weeks(1)
FundResolution.of("D") // any raw wire token

Returns

FundCandlesResponse wrapping List<FundCandle>:

public record FundCandle(
@Nullable ZonedDateTime time, // bar opening moment (America/New_York)
@Nullable Double open, // NAV at open
@Nullable Double high,
@Nullable Double low,
@Nullable Double close) // NAV at close — note: no volume

Examples

import com.marketdata.sdk.MarketDataClient;
import com.marketdata.sdk.funds.FundCandle;
import com.marketdata.sdk.funds.FundCandlesRequest;
import com.marketdata.sdk.funds.FundResolution;
import java.time.LocalDate;

try (MarketDataClient client = new MarketDataClient()) {
var candles = client.funds().candles(
FundCandlesRequest.builder(FundResolution.DAILY, "VFINX")
.from(LocalDate.now().minusWeeks(2))
.to(LocalDate.now())
.build());

for (FundCandle bar : candles.values()) {
System.out.printf("%s O=%.2f H=%.2f L=%.2f C=%.2f%n",
bar.time(), bar.open(), bar.high(), bar.low(), bar.close());
}
}