public final class PerformanceAnalyzer extends Object
Each series is rebased to the same initial value on dates observed in every column. An existing S&P 500 column is reused; otherwise the shared benchmark service downloads it. Input levels are preserved: this class does not infer trades or remove deposits and withdrawals.
Using this example. The tutorial path is analyze input, align observations, normalize each account and delegate NAV measures to shared analysis. Missing S&P 500 data is supplied through BuyAndHoldBenchmark. Imported account levels carry no execution history, so trade-dependent statistics cannot be reconstructed from them.
| Modifier and Type | Class and Description |
|---|---|
static class |
PerformanceAnalyzer.Account
One input series or benchmark, its aligned history and computed statistics.
|
static interface |
PerformanceAnalyzer.CsvLoader
Injectable source loader; production requests use the restricted public HTTPS downloader.
|
static class |
PerformanceAnalyzer.Point
One aligned observation, retaining both the original level and the normalized NAV.
|
static class |
PerformanceAnalyzer.Result
Report payload; the HTTP layer fills in persistent report identifiers and revision metadata.
|
| Modifier and Type | Field and Description |
|---|---|
static double |
BASE
Common starting NAV used to compare series expressed in different currencies or units.
|
| Constructor and Description |
|---|
PerformanceAnalyzer() |
PerformanceAnalyzer(PerformanceAnalyzer.CsvLoader loader,
BuyAndHoldBenchmark market)
Allows offline tests and other callers to supply data and benchmark services.
|
| Modifier and Type | Method and Description |
|---|---|
PerformanceAnalyzer.Result |
analyze(String url,
String start,
String end)
Downloads a public source and analyzes an optional inclusive date range.
|
PerformanceAnalyzer.Result |
analyzeCsv(String csv,
String source,
String startText,
String endText)
Analyzes CSV text without downloading the input, allowing deterministic tests.
|
static boolean |
isBenchmark(String name)
Recognizes common S&P 500 labels independently of capitalization and punctuation.
|
public static final double BASE
public PerformanceAnalyzer()
public PerformanceAnalyzer(PerformanceAnalyzer.CsvLoader loader, BuyAndHoldBenchmark market)
public PerformanceAnalyzer.Result analyze(String url, String start, String end) throws IOException
url - public Google Sheet or HTTPS CSV URLstart - ISO start date, or blank/null to use the first input dateend - ISO end date, or blank/null to use the last input dateIOException - if the source or benchmark cannot be downloadedIllegalArgumentException - if the input cannot be analyzedpublic PerformanceAnalyzer.Result analyzeCsv(String csv, String source, String startText, String endText) throws IOException
The first column must be Date; remaining columns contain daily levels, not returns. Missing values are omitted rather than forward-filled. Identical or complementary duplicate rows are merged, while conflicting observations are rejected.
csv - CSV contents, including a header rowsource - source description or URL retained in the reportstartText - inclusive ISO start date, or blank/null for the input minimumendText - inclusive ISO end date, or blank/null for the input maximumIOException - if CSV parsing or benchmark retrieval failsIllegalArgumentException - if schema, values or date overlap are invalidpublic static boolean isBenchmark(String name)
Copyright © 2026. All rights reserved.