Pricing TradeHill compared to MTGox
The problem might be that TradeHill adds orders to the Orderbook before processing them.
For example, this happened today:


Around 18h10 UTC, the highest bid was 4.842524 and the lowest ask was 4.840000
Around 22h00 UTC, the highest bid was 4.820000 and the lowest ask was 4.819900


I have also detected similar situations at ExchangeBitcoins.com.  CampBX  and MtGox seem to be matching orders before displaying them so you shouldn't have these problems there.

If you don't want to risk putting an order that will never go through, you should detect situations like this in your code and wait for the orders to solve. If the lowest ask is lower than the highest bid, something is not right.