1.6 KiB
1.6 KiB
ta4jexamples.analysis instructions
- Analysis demo classes in this package should load ossified OHLCV datasets committed under
ta4j-examples/src/main/resources(avoid live HTTP calls in the demo itself). - Long-running analysis/calibration flows must log progress and persist primary artifacts incrementally.
- Write the primary dataset/instrument result before any portability or secondary checks.
- Final aggregate JSON/bundles may append later, but must not be the only durable output.
- When adding a new analysis demo, first stage the dataset locally:
- Fetch the desired OHLCV data using an HTTP datasource (prefer
ta4jexamples.datasources.CoinbaseHttpBarSeriesDataSourcefor crypto examples) with response caching enabled. - Let the datasource paginate as needed (Coinbase is capped at 350 candles/request) and write cached JSON responses under
ta4j-examples/temp/responses. - Combine/merge the paginated cached files into a single consolidated OHLCV JSON file (deduplicate by candle start time, keep chronological ordering).
- Rename the consolidated file to the resource naming convention
{Source}-{TICKER}-{INTERVAL}-{START}_{END}.json(example:Coinbase-BTC-USD-PT1D-20230616_20231011.json) and move it tota4j-examples/src/main/resources.- Note: cached response filenames may use
PT24Hfor daily candles; resources should use thePT1D/PT4H/PT5Mstyle used byta4jexamples.datasources.file.AbstractFileBarSeriesDataSource.
- Note: cached response filenames may use
- Update the demo class to initialize its
BarSeriesfrom the resource JSON (viata4jexamples.datasources.JsonFileBarSeriesDataSource).
- Fetch the desired OHLCV data using an HTTP datasource (prefer