That raises the question:
- is there an API call to implement a MARKET order?
I'll check over at the API thread..
To place a bid market order, use very high price.
To place an ask market order, use very low price.
well - it is sort of a workaround, but it is not really the same ..
I am a bit slow to catch up here - things are moving fast. I know a bit about CME commodities futures trading, and the FIX API:
http://en.wikipedia.org/wiki/Financial_Information_eXchangeIn principal, asset exchange functions like this:
There are TWO fundamental order types: Market Orders and Limit Orders.
Limit Orders have a guaranteed price - hence 'limit order', but they don't have guaranteed execution: if there is no counteraprty at that price, the order will just hang there until it expires (if ever)
Market Orders have a guaranteed fast execution, but no guaranteed price. You get your execution 'immediately', for 'next best' price, whatever that may be.
So a market BUY order is matched againt the next best limit SELL order - i.e. the LOWEST sell price, and a market SELL order is matched against the HIGHEST buy order.
The LOWEST sell price is one tick above the HIGHEST buy price. The difference between these two is the 'spread'. Now if there are only limit orders, nothing much happens. The HIGHEST limit buy order does not just suddenly jump up on its own and buys for the LOWEST sell price - it can't, because it is a limit order. It may be that a new limit order or is entered, that crosses up or down to where another limit order of the opposite order book happens to lurking around - but that is rather rare.
The real action comes from the interplay between market orders and limit orders, and the fact that a trade is always sort of an annihilation of opposing particles: SellOrder + BuyOrder ->TradeExecution. Sort of like positron+electron -> photon
Apologies if I should be preaching to the choir here - I have no idea about you guys backgrounds. But latching on to opticalcarriers question there, I'd also be interersted in getting to know how to use MARKET orders and create assets ledgers and stuff like that in order to make a powerful asset exchange on nxt ...