I think the most correct way is
IContext.getReportService() -> getOpenPositions() | getClosedPositions() -> getSwaps()
Another way - evaluate difference in price of 'first open' and 'last open' in IOrder.getFillHistory()' and calculate amount of money out of that. In normal conditions - there is new entry each day with open price adjusted with nightly swap pips
Fill Time: 2018-06-06 23:16:39.000
Filled: #0: 2018-06-06 23:16:39.000 - 9000 * 1.1770811
#1: 2018-06-07 00:05:50.000 - 9000 * 1.177302
#2: 2018-06-08 00:06:46.000 - 9000 * 1.177376
BUT, from practice I see that it DOES NOT always work this way. Rather frequently 'fill history' contains only 'initial' fill for orders lasting many days.