Placing and canceling orders
Typically you would place or cancel orders in DoProcessBar function of your Ticker
Strategy. There is a number of functions that can place orders:
BuyMarket
SellMarket
SellShortMarket
BuyBackMarket
BuyStop
SellStop
SellShortStop
BuyBackStop
BuyLimit
SellLimit
SellShortLimit
BuyBackLimit
All of these functions create and return IOrder object. For example you can place stop sell GTC order
by calling SellStop function and then setting TimeInForce property of the order object:
Call Cancel
function to cancel order. The following code example cancels last placed order if its
direction is long:
|