Skip to content

Commit 2c815cf

Browse files
committed
bond calculation
1 parent 8eb9a95 commit 2c815cf

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎lib/ib-xml-parser.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,11 @@ export function convertToFormPosition(trade: IBTrade) {
403403
purchasePrice = Math.abs(trade.cost)
404404
salePrice = Math.abs(trade.cost + trade.fifoPnlRealized)
405405
}
406+
} else if (assetType === "bonds") {
407+
408+
purchasePrice = trade.cost
409+
salePrice = Math.abs(trade.cost + trade.fifoPnlRealized)
410+
406411
} else {
407412
// For other asset types (bonds, crypto, etc.):
408413
// Use the same logic as options

0 commit comments

Comments
 (0)