Instantiate a new OrderFillTransaction from a dict (generally from
        loading a JSON response). The data used to instantiate the
        OrderFillTransaction is a shallow copy of the dict passed in, with any
        complex child types instantiated appropriately.

def from_dict(data, ctx):
        """
        Instantiate a new OrderFillTransaction from a dict (generally from
        loading a JSON response). The data used to instantiate the
        OrderFillTransaction is a shallow copy of the dict passed in, with any
        complex child types instantiated appropriately.
        """

        data = data.copy()

        if data.get('units') is not None:
            data['units'] = ctx.convert_decimal_number(
                data.get('units')
            )

        if data.get('gainQuoteHomeConversionFactor') is not None:
            data['gainQuoteHomeConversionFactor'] = ctx.convert_decimal_number(
                data.get('gainQuoteHomeConversionFactor')
            )

        if data.get('lossQuoteHomeConversionFactor') is not None:
            data['lossQuoteHomeConversionFactor'] = ctx.convert_decimal_number(
                data.get('lossQuoteHomeConversionFactor')
            )

        if data.get('price') is not None:
            data['price'] = ctx.convert_decimal_number(
                data.get('price')
            )

        if data.get('fullVWAP') is not None:
            data['fullVWAP'] = ctx.convert_decimal_number(
                data.get('fullVWAP')
            )

        if data.get('fullPrice') is not None:
            data['fullPrice'] = \
                ctx.pricing.ClientPrice.from_dict(
                    data['fullPrice'], ctx
                )

        if data.get('pl') is not None:
            data['pl'] = ctx.convert_decimal_number(
                data.get('pl')
            )

        if data.get('financing') is not None:
            data['financing'] = ctx.convert_decimal_number(
                data.get('financing')
            )

        if data.get('commission') is not None:
            data['commission'] = ctx.convert_decimal_number(
                data.get('commission')
            )

        if data.get('guaranteedExecutionFee') is not None:
            data['guaranteedExecutionFee'] = ctx.convert_decimal_number(
                data.get('guaranteedExecutionFee')
            )

        if data.get('accountBalance') is not None:
            data['accountBalance'] = ctx.convert_decimal_number(
                data.get('accountBalance')
            )

        if data.get('tradeOpened') is not None:
            data['tradeOpened'] = \
                ctx.transaction.TradeOpen.from_dict(
                    data['tradeOpened'], ctx
                )

        if data.get('tradesClosed') is not None:
            data['tradesClosed'] = [
                ctx.transaction.TradeReduce.from_dict(d, ctx)
                for d in data.get('tradesClosed')
            ]

        if data.get('tradeReduced') is not None:
            data['tradeReduced'] = \
                ctx.transaction.TradeReduce.from_dict(
                    data['tradeReduced'], ctx
                )

        if data.get('halfSpreadCost') is not None:
            data['halfSpreadCost'] = ctx.convert_decimal_number(
                data.get('halfSpreadCost')
            )

        return OrderFillTransaction(**data)