Implementing a Statement Parser

From QPAS Documentation
Jump to: navigation, search

Implementing a Statement Parser

To add support for your broker, you'll need to implement the IStatementParser (and potentially the IStatementDownloader) interfaces for your broker's statement format.

The implementations of these interfaces are dynamically loaded, both from the application's own assembly and from dlls in the /Plugin folder, using MEF. Besides implementing the interface, you also have to add a couple of attributes to the class so it will be loaded correctly:

    [Export(typeof(IStatementParser))]
    [ExportMetadata("Name", "The Name of Your Plugin Here")]

Important: if you implement both IStatementParser and IStatementDownloader, they must have the same metadata Name value.

The entities that are absolutely necessary are Account, Instrument, EquitySummary (only the Total field), and Order. Unless you add PriorPeriodPositions, an external datasource (such as QDMS) is required for operation. For execution analysis to work, you must add Executions. To support instruments in non-USD currencies you'll need to add FXRates.

The flex query reference might be helpful to clarify the exact content of each field.