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

def from_dict(data, ctx):
        """
        Instantiate a new TradeReduce from a dict (generally from loading a
        JSON response). The data used to instantiate the TradeReduce 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('price') is not None:
            data['price'] = ctx.convert_decimal_number(
                data.get('price')
            )

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

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

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

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

        return TradeReduce(**data)