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

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

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

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

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

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

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

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

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

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

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

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

        return MarketOrderTransaction(**data)