In your Ledger history, there are three values you need to look for:
|Margin profits/losses (not including fees)||Margin||Amount|
|Margin opening & closing fees||Margin||Fee|
|Margin rollover fees||Rollover||Fee|
Note: Ledger entries where "type" is "Trade" only apply to non-margin trades.
What is it? Margin profit/loss is determined by the size of your margin position and the price difference between your opening trade and your closing trade. Profits/losses are not directly determined by your level of leverage.
How to count it? For all Ledger entries where the "type" is "Margin", sum up the values in the "Amount" column.
If amount = 0, it's a trade that opened a margin position (and therefore no profit/loss yet).
If amount is >0 (positive), it's a profit from closing all or part of a margin position.
If amount is <0 (negative), it's a loss from closing all or part of a margin position.
Note: profit/loss amounts do not include fees.
2. Opening & closing fees
What is it? Opening & closing fees are charged when your order is executed (matched with another client's order) and a margin position is opened or closed as a result.
How to count it? For all Ledger entries where the "type" is "Margin", sum up the values in the "Fee" column.
Note: opening & closing fees do not include the margin rollover fees.
3. Rollover fees
What is it? Rollover fees are charged every 4 hours that your margin position is held open, because margin trading involves borrowed funds.
How to count it? For all Ledger entries where the "type" is "Rollover", sum up the values in the "Fee" column.
Note: The "amount" column should always be 0 for rollover fees.