How to associate rollover fees with margin trades

You'll need to go to History > Export and do both a "ledgers" export and a "trades" export.
 

Method 1: start with Trades export

To find all the rollover fees applied to a given trade, start from a given entry in the trades export.

The IDs under "ledgers" is a list of all the ledger IDs associated with that trade, including all the ledger IDs for the rollover fees assessed for that trade.

For example, you might have the following ledger IDs associated with this trade: L2UMHE-XARGI-JAYO5O, LYZAGQ-CCLOH-C7SESD, LGSVAI-5VW3I-DZJWCI, LKJSX5-LQDGJ-LC64IO. The first 3 IDs are the ledger IDs for the rollover fees and the last ID is the ledger ID for the trade that opened the margin position. So in this example, assuming the position is now closed, the position was charged 3 rollover fees while it was open. Looking these 3 ledger IDs up in the ledgers export will tell you what the rollover fees were for this position.
 

Method 2: start with Ledgers export

You can also go the other way to find the trade associated with a given rollover fee.

Take a given rollover fee in the ledgers export and grab it's ledger ID (it's the "txid" in the export - e.g. L2UMHE-XARGI-JAYO5O).

Now search the trades export for this txid. It will match under the "ledgers" column which is a list of all the ledger entries for a given trade. The associated trade is the trade that opened the position.

The "txid" entry for the row where you get the match is the trade ID of the associated trade (e.g. TC2YOK-QBNAA-UFAQRV). If you do a full "trades" export, the row will also have a bunch of other information about the trade (the associated order ID, volume, etc.).
 

We realize this is not the most convenient way of associating rollover fees with margin trades. Unfortunately, it is currently the only way, but we are developing an easier way to do this.