def update(new_attributes)
      new_attributes = { limit_level: limit_level, stop_level: stop_level, trailing_stop: trailing_stop?,
                         trailing_stop_distance: trailing_stop_distance, trailing_stop_increment: trailing_step }
                       .merge new_attributes

      unless new_attributes[:trailing_stop]
        new_attributes[:trailing_stop_distance] = new_attributes[:trailing_stop_increment] = nil
      end

      body = RequestBodyFormatter.format PositionUpdateAttributes.new(new_attributes)

      @dealing_platform.session.put("positions/otc/#{deal_id}", body, API_V2).fetch(:deal_reference)
    end
def update(new_attributes)
      new_attributes = { limit_level: limit_level, stop_level: stop_level, trailing_stop: trailing_stop?,
                         trailing_stop_distance: trailing_stop_distance, trailing_stop_increment: trailing_step }
                       .merge new_attributes

      unless new_attributes[:trailing_stop]
        new_attributes[:trailing_stop_distance] = new_attributes[:trailing_stop_increment] = nil
      end

      body = RequestBodyFormatter.format PositionUpdateAttributes.new(new_attributes)

      @dealing_platform.session.put("positions/otc/#{deal_id}", body, API_V2).fetch(:deal_reference)
    end
Updates this position. No attributes are mandatory, and any attributes not specified will be kept at their
 current value.

 @param [Hash] new_attributes The attributes of this position to update.
 @option new_attributes [Float] :limit_level The new limit level for this position.
 @option new_attributes [Float] :stop_level The new stop level for this position.
 @option new_attributes [Boolean] :trailing_stop Whether to use a trailing stop for this position.
 @option new_attributes [Integer] :trailing_stop_distance The distance away in pips to place the trailing stop.
 @option new_attributes [Integer] :trailing_stop_increment The step increment to use for the trailing stop.

 @return [String] The deal reference of the update operation. Use {DealingPlatform#deal_confirmation} to check
         the result of the position update.