Does anybody know what happens when the bid is not equal to but higher than the ask? What is the price that will be used? Or will this not lead to a transaction at all?
As others have mentioned this depends on how matching works on the exchange.
The case where the bid is higher or equal to the ask is known as a "crossed book". I most cases, this should never happen and if it does it would be as a result of a bug in the matching algorithm. If you place a buy/sell order with a price that is in excess of the best ask/bid respectively then that order will be matched against the opposite side. Under normal conditions what you suggested should be impossible.
Generally if a bid is introduced that is higher than the ask, the volume at the ask is matched, then the volume leftover at each ask level is matched in order of price (then time).
I don't know the answer, but I think it would make sense to consider which offer came in first:
First case: you ask for 100 and then I bid 105 --> transaction clears at 100, the ask price
Second case: I bid 105 and then you ask for 100 --> transaction clears at 105, the bid price
This is because I implicitly think about bid offers as "I want to buy this for at most X dollars" and ask offers as "I want to sell this for at least X dollars".
Yes, usually transactions are executed at the resting order prices (i.e. whatever is already being advertised in the market, and a transaction can involve multiple orders at different prices).