def update_order(bet_id, delta_stake, price, expected_selection_reset_count,
    expected_withdrawal_sequence_number, cancel_on_in_running=None,
    cancel_if_selection_reset=None, set_to_be_sp_if_unmatched=None):
    """
    Create an update order to send to exchange.

    :param bet_id: ID of the bet to be updated.
    :type bet_id: int
    :param delta_stake: Amount to change the stake of the bet by.
    :type delta_stake: float
    :param price: Price at which to place bet at.
    :type price: float
    :param expected_selection_reset_count: must match SelectionResetCount value in GetMarketInformation and GetPrices
                                        to ensure state of the market before placing a bet. If not matching server
                                        bet will not be placed and error is raised.
    :type expected_selection_reset_count: int
    :param expected_withdrawal_sequence_number: should match withdrawalSequenceNumber value in GetMarketInformation and
                                             GetPrices. If not matching server then your bet WILL be accepted, but it
                                             will be repriced.
    :type expected_withdrawal_sequence_number: int
    :param cancel_on_in_running: Cancel any unmatched orders when the market changes to an in-running market.
    :type cancel_on_in_running: betdaq_py.enums.Boolean
    :param cancel_if_selection_reset: Cancel any unmatched bets if the selection is reset.
                                   This can occur when the Market is reset (eg a goal is scored).
    :type cancel_if_selection_reset: betdaq_py.enums.Boolean
    :param set_to_be_sp_if_unmatched: whether to set bet to SP when market turns in play if it is unmatched.
    :type set_to_be_sp_if_unmatched: betdaq_py.enums.Boolean
    :return: dictionary of the order information to update on exchange.
    """
    resp = {'_BetId': bet_id, '_DeltaStake': delta_stake, '_Price': price,
        '_ExpectedSelectionResetCount': expected_selection_reset_count,
        '_ExpectedWithdrawalSequenceNumber':
        expected_withdrawal_sequence_number}
    if cancel_on_in_running is not None:
        resp['_CancelOnInRunning'] = cancel_on_in_running
    if cancel_if_selection_reset is not None:
        resp['_CancelIfSelectionReset'] = cancel_if_selection_reset
    if set_to_be_sp_if_unmatched is not None:
        resp['_SetToBeSPIfUnmatched'] = set_to_be_sp_if_unmatched
    return resp
