any way to cancel a order?
-
- Posts: 83
- Joined: 18 Mar 2013
- Has thanked: 11 times
any way to cancel a order?
For limit order buy_order.send(), is there anyway to cancel it next period?
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: any way to cancel a order?
Hello maisatomai,
In MultiCharts .Net there are two approaches for order generation: managed and umanaged orders.
Managed orders are monitored by the strategy. Strategy can be trading only one instrument that is the main data series of your chart. The orders are valid at broker while they are sent by the strategy. That means the conditions for order generation should be met in your code on each bar close or each tick (if IOG=ON) calculation while you need to keep your orders active.
If you want to modify an order - just change the parameter you need (price or quantity) and the order will be modified or cancelled and resubmitted (depends on broker). Here is an example how to modify the amount of contracts for the order. If you want to cancel the order-stop sending it from the code (make the conditions for order generation invalid).
With unmanaged orders you can trade on multiple symbols through different broker plugins directly from one script. The symbols don't need to be on the chart, but you are responsible for managing your orders if you are using this approach. Here is an example of how to use the TradeManager. Another example - Trading from MultiCharts Realtime Market Scanner.
For more information please refer to .Net programming guide: Extended Trading Possibilities. TradeManager:1, 2, 3, 4.
In MultiCharts .Net there are two approaches for order generation: managed and umanaged orders.
Managed orders are monitored by the strategy. Strategy can be trading only one instrument that is the main data series of your chart. The orders are valid at broker while they are sent by the strategy. That means the conditions for order generation should be met in your code on each bar close or each tick (if IOG=ON) calculation while you need to keep your orders active.
If you want to modify an order - just change the parameter you need (price or quantity) and the order will be modified or cancelled and resubmitted (depends on broker). Here is an example how to modify the amount of contracts for the order. If you want to cancel the order-stop sending it from the code (make the conditions for order generation invalid).
With unmanaged orders you can trade on multiple symbols through different broker plugins directly from one script. The symbols don't need to be on the chart, but you are responsible for managing your orders if you are using this approach. Here is an example of how to use the TradeManager. Another example - Trading from MultiCharts Realtime Market Scanner.
For more information please refer to .Net programming guide: Extended Trading Possibilities. TradeManager:1, 2, 3, 4.