How theorycraft-trading/dukascopy works
Dukascopy is an Elixir client and CLI for downloading and streaming historical tick and bar data from Dukascopy. The primary workflow validates an instrument, timeframe, and date range; selects and fetches the appropriate historical files; then exposes tick/bar events, optionally resampled for the requested timeframe. The README also documents instrument search and CLI serialization to CSV, JSON, NDJSON, or no file. The graph includes those documented capabilities, but several runtime modules were not sampled, so uncertain internal calls are omitted.
Main entry points: dukascopy.ex Stream API · cli.ex CLI commands · paginator.ex Page retrieval · instruments.ex Instrument catalog
Components 22
Streaming API
- Stream API
lib/dukascopy.ex - Option validation
lib/dukascopy/options.ex - TheoryCraft feed
lib/dukascopy/data_feed.ex
Historical Fetch
- Bar data
lib/dukascopy/bar_data.ex - Tick data
lib/dukascopy/tick_data.ex - Page retrieval
lib/dukascopy/paginator.ex - Page results
lib/dukascopy/page.ex - Page cursor
lib/dukascopy/cursor.ex - Fetch periods
lib/dukascopy/helpers/period_generator.ex - Range fallback
lib/dukascopy/helpers/time_range.ex - URL generation
lib/dukascopy/helpers/url_generator.ex - HTTP client
lib/dukascopy/client.ex
Instrument Catalog
- Instrument catalog
lib/dukascopy/instruments.ex - Instrument metadata
priv/instruments.json
Command Line
- CLI commands
lib/dukascopy/cli.ex - CLI options
lib/dukascopy/cli/options.ex - Output formatter
lib/dukascopy/cli/formatter.ex - CLI output
lib/dukascopy/cli/printer.ex
Other components
- API consumer
- Dukascopy datafeed
- File cache
- Downloaded files
Connections 17
- API consumer → Stream API: requests stream
- Stream API → Option validation: validates options
- Stream API → Page retrieval: fetches page
- Stream API → TheoryCraft feed: builds feed
- Stream API → API consumer: returns events
- Page retrieval → Page cursor: uses cursor
- Page retrieval → Page results: returns page
- URL generation → Instrument catalog: looks up filename
- Instrument catalog → Instrument metadata: loads metadata
- HTTP client → Dukascopy datafeed: requests files
- HTTP client → File cache: reads/writes
- CLI commands → CLI options: parses arguments
- CLI commands → Stream API: requests stream
- CLI commands → Instrument catalog: searches catalog
- CLI commands → Output formatter: formats events
- CLI commands → CLI output: prints status
- Output formatter → Downloaded files: serializes output