Click here to Login




How to set order type of a trading system programmatically

Updated on 2011-11-08





Order types can be specified in the "Update Trading System" form by updating the fields just above buy, sell, short and cover rules controls.

Example:
Buy using limit order at tomorrow (limit = close)

Here are the trading order types that are available in QuantShare:
Market at open
Market at close
Limit order
Stop order
Stop limit order

To change an order type using QL (QuantShare Language):

- Select "Create trading system using the formula editor" tab
- Type the next lines to associate a limit order to buy signals

SetSimTiming(_Buy, _Limit, 1);
BuyPrice(close * 0.99, 10);


The "SetSimTiming" function allows you to specify an order type to associate with a signal type. Here, we associate limit order type to buy signals. We set "1" in the third parameter to indicate that we want to execute the order tomorrow (signal date + 1).

The "BuyPrice" function allows you to specify the limit or/and stop price of an order. Here, we indicate that the limit price is 1% below the close price and that the order is valid for 10 days only. After this period, the order is automatically removed.

To get the list of available fields in a parameter, click on this parameter then use the CONTROL+SPACE shortcut.











no comments (Log in)

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 © 2012 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items