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
QuantShare
Search Posts




QuantShare
Recent Posts

Create Graphs using the Grid Tool
Posted 1239 days ago

Profile Graphs
Posted 1344 days ago

QuantShare
Previous Posts

Limit and Market orders
Posted 5375 days ago

Ranking system calculation methods
Posted 5384 days ago

RSS feeds transformation
Posted 5388 days ago

Stocks: Market Capitalization
Posted 5390 days ago

Ranking System Engine
Posted 5392 days ago

How to deal with StockTwits data
Posted 5402 days ago

Trend following systems
Posted 5405 days ago

Working with the formula editor
Posted 5407 days ago


More Posts

Back







QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
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.