Click here to Login

Limit and Market orders

Updated on 2009-08-07

A trading order is an instruction you send to your broker in order to buy, sell, short or cover a security. There are different types of orders, but they all share some common characteristics like the security symbol or ID and the number of shares to enter or exit.

An order can be a buy order or a sell order, the former is used to buy or cover a security while the latter is used to sell or short a security. If you want to take a long position on a security, you have to use a buy order to enter the trade and a sell order to exit the trade. But if you want to be short on a security, you have to do the opposite, that is, send a sell order to short the security and then a buy order whenever you want to cover your position.

Some brokers like "interactive brokers" offers over 50 order types, many of them are algorithms and conditional orders that execute basic orders when triggered.

Here is a list of basic order types:

Market Order: This order is executed at the best price available (Generally a buy order is executed at the ask price and the sell order at the bid price).

Limit Order: A limit order is an order to buy or sell an asset at a specific price. In the QuantShare backtesting engine, you can define a limit order as shown in the picture below.

The order is executed only if the price you specify in the limit order is between the high and low price of a security, otherwise the order won't be filled and the high-low boundaries will be checked during the next trading bar. You can of course specify the number of days or bars to keep the trading order. This is done using the functions: BuyPrice, SellPrice, ShortPrice and CoverPrice. If after the specified number of bars the order is not filled yet, it will be automatically transformed into a Market-On-Open order. (The limit order is canceled and a MOO order is created).

Market-On-Open (MOO): This is the default market order used by the QuantShare backtester. It is a market order that is submitted at the market's open. The filled price is the open price of the security at the day the order was submitted.

Market-On-Close (MOC): This is also a market order; this order is automatically submitted at the market's close.

Stop Order: This is an order that instructs the broker to submit a buy or sell order if the user-defined stop trigger price is reached. This order is used by the different implementations of stops (Stop loss, Trailing stop, Profit stop and N-Bar stop). If a stop limit is reached then the QuantShare backtester transforms the Stop order into a Market order or a Market-On-Open order. Depending on your trading system settings, the simulator will submit a market order and you will be filled at the trigger price or a MOO order is submitted and you will be filled at the next bar open price.
In backtesting, setting the simulator to take a market order (you will be filled at the stop trigger price) after a stop price is reached is not a good idea because generally in a real trading environment your order will be filled at a much worse price that the trigger price. As an example imagine a stock that you own is hit by a bad news, and let us say that your trigger exit price is 9 dollars. If the stock price moves from 10 dollars to 8 dollars (gap), the backtester will exit the position at 9 dollars. But in reality the real exit price is near 8 dollars.

no comments (Log in)

QuantShare Blog
Search Posts

Recent Posts

Create Graphs using the Grid Tool
Posted 1328 days ago

Profile Graphs
Posted 1433 days ago

Previous Posts

Limit and Market orders
Posted 5464 days ago

Ranking system calculation methods
Posted 5473 days ago

RSS feeds transformation
Posted 5477 days ago

Stocks: Market Capitalization
Posted 5479 days ago

Ranking System Engine
Posted 5481 days ago

How to deal with StockTwits data
Posted 5491 days ago

Trend following systems
Posted 5494 days ago

Working with the formula editor
Posted 5496 days ago

More Posts


Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2024
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Follow us on Google+
RSS Trading Items

Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.