Click here to Login




Trading orders - Part 2

Updated on 2009-11-10





This is the second part of the "Trading Orders" article; you can read the first part here: Trading Orders.
In the last paragraph of the first part, we tried to respond to the question: Why are some signals rejected?
We introduced how signals are preceded and why some of them are rejected, we then talked about filters and how signals should pass these filters in order to be accepted.

Here is a list of the most important filters:
- There must be enough cash and available positions
- There is an opposite order. Example: The simulator has a signal to buy the stock "A" and at the same time, there is a pending order to sell the stock "A". In that particular case, the default behavior is to close the pending sell order and reject the current signal.
- The signal order must not exist in the re-enter stop list. This list is used to store securities that should not be entered for a specific number of bars after a previous stop for the same security was executed.
- The signal's security symbol should not exist in the buy pending order list, in case it is a buy signal.
- The signal’s security symbol should not exist in the portfolio
- The estimated order size should be higher than the minimum order size specified in the simulation settings
- The money management "OnNewPosition" event should not reject the signal

Once a signal is accepted, it is transferred to the orders factory, which will transform this signal into a trading order. The orders factory will reduce the amount of available cash by the order size and decrement the number of available positions by one. Note that, we can only get an approximate order size; this is because, if the order is for example "Buy at open, tomorrow" then we will not have access to the open price of tomorrow. Therefore, to resolve this issue we use the current close price to calculate the approximate order size.

Trading Orders Filters:
The next step is to execute these orders at the following period. First, the simulator will only try to execute orders that have no lag value. In fact, you can specify a lag value in an order (Buy at tomorrow + 2, create an order with a lag of 2), so that the order is executed only after the specified number in the lag field.
As with the transformation of signals to orders, the execution of orders is not always possible. Several things could prevent the simulator from executing an order. The simulator is able to simulate things as if the order is transmitted to a broker then to an exchange.
This is a non-exhaustive list of what can prevent an order from being executed:
- The order has a lag value. Therefore, it will not be executed at the current period. In this case, the lag value of the order is decremented by one at each period.
- The order is a limit order and the limit price is not reached. Example: You want to buy a stock for a price of 20$, but today low price is 21$.
- There are no market data for the order’s security (stock, futures, options…) at the current period.
- The security to be bought is a penny stock and the simulator settings is set to reject penny stocks
- There is no enough volume to buy the security.

You can update the last two filter settings by selecting a trading system, then clicking on "Update". Once the "Update Trading System" form appears, select "Settings" in the top menu then click on the "Capital" button.

Orders that are not executed are kept for five bars by default. This value can of course be changed by the user. An exit order behaves differently; after the default number of bars is exceeded, the order is automatically transformed into a market order so that the execution is guaranteed.











no comments (Log in)

QuantShare Blog
QuantShare
Search Posts




QuantShare
Recent Posts

Create Graphs using the Grid Tool
Posted 1400 days ago

Profile Graphs
Posted 1505 days ago

QuantShare
Previous Posts

Trading orders - Part 2
Posted 5441 days ago

Trading Orders - Part 1
Posted 5448 days ago

Sharpe Ratio - Part 2
Posted 5469 days ago

Sharpe Ratio - Part 1
Posted 5475 days ago

The 'inside period' function
Posted 5489 days ago

Quantshare version 1.4
Posted 5503 days ago

Looking for trading ideas
Posted 5509 days ago

A vector-based language
Posted 5512 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.