How to add a data loader
A loader reads one file format. It inherits TDataLoader and implements LoadDataSetActually, then registers itself with the extensions and the format name it claims.
The Open dialog's filter is built from that registry, so a build can only offer a format something in it can actually read. Adding a loader therefore needs no edit to any existing file.
flowchart TB
unit["`**Your loader**
class(TDataLoader)`"]
reg["`**RegisterDataLoader**
class, extensions, format name`"]
registry["`**The loader registry**`"]
filter["`**The Open dialog filter**
derived, never hand-written`"]
open["`**Opening a file**
FindDataLoaderClass by extension`"]
unit --> reg --> registry
registry --> filter
registry --> open
Registered in this build
| Format | Extensions | Class |
|---|---|---|
| Diffraction profile | .DAT | TDATFileLoader |
| Price data, OHLC | .CSV | TOHLCFileLoader |
Full instructions: writing a module.