Add sub-day research bars, ECB crosses and FX minute import

Phase 12 needs intraday bars and the 28 currency pairs for the basket
research, without touching the daily backtest engine.

- Timeframes gain 15m, 30m, 1h, 4h, 8h with Length and IsIntraday; the
  CSV import checks any intraday timeframe minute-style at its length
  instead of sending it to the daily check.
- BarAggregator builds longer bars in decimal on UTC epoch buckets,
  never fills a gap and leaves out a bucket that has not closed.
- Bar calendars (24x7, 24x5 FX from Sunday to Friday 17:00 New York,
  exchange sessions) and BarDataset: a common clock in double columns,
  NaN where a series has no bar, optional ask columns, Through that only
  shows closed bars, and a fingerprint of the data.
- EcbCrosses derives the 28 pairs (from the shared Baskets list) from
  the seven ECB rates; "anubis data ecb" writes them under research/ecb
  from the same cached zip as "backtest base", whose loader moves into
  the library with its output unchanged.
- CsvImporter.Parse is split out of ImportAsync and mappings accept a
  fixed offset such as UTC-05:00.
- "anubis data fx" reads Dukascopy and HistData one-minute files,
  refuses anything else in Italian, drops bars outside the FX week and
  writes the 1m and 15m series. The formats come from general knowledge:
  the fixtures are constructed samples, as API-NOTES says.

refs #120

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-12-04 10:06:44 +01:00
1 parent aec848b4a2
commit 2a96e08d5a
17 files changed
+1636 -46

No files matched your search

+11 -1
View File
@@ -290,7 +290,7 @@ Chi aggiorna da una versione precedente trova nel Diario una riga sola: da quest
}
```
Le colonne si indicano con il nome dell'intestazione o con il numero, contando da 0. `timeframe` è `1m` (al minuto) o `1d` (giornaliero). `time_format` è `auto`, `unix_s`, `unix_ms`, `unix_us` o un formato di data. `continuous` è `true` per i mercati che non chiudono mai (crypto), `false` per le azioni. Poi:
Le colonne si indicano con il nome dell'intestazione o con il numero, contando da 0. `timeframe` è `1m` (al minuto), `15m`, `30m`, `1h`, `4h`, `8h` o `1d` (giornaliero). `time_format` è `auto`, `unix_s`, `unix_ms`, `unix_us` o un formato di data. `time_zone` è un fuso come `Europe/Rome` oppure uno spostamento fisso tutto l'anno come `UTC-05:00`. `continuous` è `true` per i mercati che non chiudono mai (crypto), `false` per le azioni. Poi:
```sh
docker exec -u 99:100 -e HOME=/tmp anubis dotnet /app/Anubis.Server.dll data csv /data/import/file.csv
@@ -298,6 +298,16 @@ docker exec -u 99:100 -e HOME=/tmp anubis dotnet /app/Anubis.Server.dll data csv
Se hai impostato `PUID` e `PGID`, metti quei numeri al posto di `99:100`. Il comando scrive quante barre ha letto e i problemi trovati.
**Valute per la ricerca.** Due comandi preparano le 28 coppie delle otto valute (EUR, GBP, AUD, NZD, USD, CAD, CHF, JPY) nello storico di ricerca; il bot non le usa per decidere.
- `data ecb` ricava ogni giorno dal 1999 le 28 coppie dai cambi di riferimento della BCE (per esempio USDJPY è il cambio dello yen diviso quello del dollaro). Scarica lo stesso file di `backtest base`; con `--offline` usa quello già scaricato.
- `data fx <file>` legge un file a un minuto che scarichi tu da Dukascopy (un file per il prezzo denaro, `_BID_` nel nome, e uno per la lettera, `_ASK_`, in ora GMT) o da HistData (formato ASCII generico, `DAT_ASCII_EURUSD_M1_2024.csv`, solo denaro). Scrive le barre da un minuto e quelle da 15 minuti costruite da quelle. Se il nome del file non dice la coppia, aggiungi `--symbol EURUSD`. Le barre del fine settimana vengono lasciate fuori e il comando dice quante. Un formato diverso viene rifiutato con la spiegazione.
```sh
docker exec -u 99:100 -e HOME=/tmp anubis dotnet /app/Anubis.Server.dll data ecb
docker exec -u 99:100 -e HOME=/tmp anubis dotnet /app/Anubis.Server.dll data fx /data/import/DAT_ASCII_EURUSD_M1_2024.csv
```
Attenzione: il Laboratorio legge dallo storico di ricerca solo le serie giornaliere di Binance. I dati importati con `"venue": "import"` restano in archivio e il Laboratorio **non li usa**. Per usarli servono `"venue": "binance"`, `"timeframe": "1d"` e un simbolo di Binance come `BTCUSDT`: in quel caso le tue barre **sostituiscono** quelle già scaricate per gli stessi giorni, anche per la revisione trimestrale. Fallo solo se sei sicuro dei dati.
---