def calculate_realized_pnl(self, is_buy):
        self.realized_pnl += self.qty * (
            (self.opening_price - self.executed_price)
            if is_buy else
            (self.executed_price - self.opening_price))
dataset/ETHPy150Open jamesmawm/Mastering-Python-for-Finance-source-codes/B03898_08_codes/ForexSystem.py/ForexSystem.calculate_realized_pnl/original