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, 0);
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 "0" 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 © 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.