Skip to content

Commit e43c0c2

Browse files
committed
Improve FOREX trade skip warning message format
Show trade details in a readable format instead of raw JSON dict.
1 parent 6d28f5b commit e43c0c2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • investments/report_parsers

investments/report_parsers/ib.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ def _parse_instrument_information(self, f: Dict[str, str]):
279279
def _parse_trades(self, f: Dict[str, str]):
280280
ticker_kind = _parse_tickerkind(f['Asset Category'])
281281
if ticker_kind == TickerKind.Forex:
282-
logging.warning(f'Skipping FOREX trade (not supported yet), your final report may be incorrect! {f}')
282+
logging.warning(
283+
f'Skipping FOREX trade (not supported yet), your final report may be incorrect! '
284+
f'{f.get("Date/Time")}, {f.get("Currency")} {f.get("Symbol")} {f.get("Quantity")} @ {f.get("T. Price")} = {f.get("Proceeds")}, commission = {f.get("Comm in USD")}'
285+
)
283286
return
284287

285288
ticker = self._tickers.get_ticker(f['Symbol'], ticker_kind)

0 commit comments

Comments
 (0)