code: def test_add_closing_trades(self):
      dates = date_range(start="2015-01-01", periods=20)
      transactions = DataFrame(
          data=[[2, 10, "A"], [-5, 10, "A"], [-1, 10, "B"]],
          columns=["amount", "price", "symbol"],
          index=dates[:3],
      )
      positions = DataFrame(
          data=[[20, 10, 0], [-30, 10, 30], [-60, 0, 30]],
          columns=["A", "B", "cash"],
          index=dates[:3],
      )
  
      expected_ix = dates[:3].append(
          DatetimeIndex([dates[2] + Timedelta(seconds=1)])
      )
      expected = DataFrame(
          data=[
              [2, 10, "A"],
              [-5, 10, "A"],
              [-1, 10.0, "B"],
              [3, 20.0, "A"],
          ],
          columns=["amount", "price", "symbol"],
          index=expected_ix,
      )
  
      transactions_closed = add_closing_transactions(
          positions, transactions
      )
      assert_frame_equal(transactions_closed, expected)
  
file_path: pyfolio/pyfolio/tests/test_round_trips.py
imports: from nose_parameterized import parameterized
  from unittest import TestCase
  from pandas import Series, DataFrame, DatetimeIndex, date_range, Timedelta, read_csv
  from pandas.util.testing import assert_frame_equal
  import os
  import gzip
  from pyfolio.round_trips import extract_round_trips, add_closing_transactions, _groupby_consecutive
label_desc: Use image node_id 3 for calling the RoundTripTestCase obj's underlying member method code with example usage: obj.test_add_closing_trades() without return types