Changes

Jump to navigation Jump to search

4.6.1 Orders

120 bytes added, 09:49, 6 May 2013
no edit summary
'''Order objects are created only in Create() method using OrderCreator:'''
1) ''{{Color|Blue|IOrderMarket OrderCreator.MarketNextBar(SOrderParameters orderParams);}}'' - creates a Market order that should be sent at the Open of the next bar, the one after the bar where the order was generated.<br> 2) ''{{Color|Blue|IOrderMarket OrderCreator.MarketThisBar(SOrderParameters orderParams);}}'' - creates a Market order that should be sent on the Close of the bar where it was generated. <br>3) ''{{Color|Blue|IOrderPriced OrderCreator.Limit(SOrderParameters orderParams);}}'' - creates a price Limit order that should be sent at the Open of the next bar, the one after the bar where the order was generated. A Limit order can be filled at the price set, or better, in '''Send()''' method when generating the order where buy equals order price and lower and sell equals order price and higher.<br>4) ''{{Color|Blue|IOrderPriced OrderCreator.Stop(SOrderParameters orderParams);}}'' - creates a price Stop order that should be sent at the Open of the next bar, the one after the bar where the order was generated. Stop order can be filled at the price set, or worse, in '''Send ()''' when generating the order buy equals order price and lower and sell equals order price and higher.<br>5) ''{{Color|Blue|IOrderStopLimit OrderCreator.StopLimit(SOrderParameters orderParams);}}'' - creates algorithmic Limit order with a Stop condition that should be sent at the Open of the next bar, the one after the bar where the order was generated.<br>
The following structure is used to create an order object in all the '''OrderCreator()''' methods:
Settings:
* ''{{Color|Blue|EOrderAction:}}''
Buy – long position entry (buying). If the short position is currently opened, then it will be closed and the long one will be opened.
BuyToCover – short position exit (buying). This order cannot be sent, if the short position is not opened.
* ''{{Color|Blue|Contracts:}}''
Default – the quantity of contracts is calculated, according to the strategy settings in Strategy Properties window.
name – Custom name of the order.
* ''{{Color|Blue|OrderExit:}}''
FromAll – closes all entries, which opened the position. If the quantity of contracts is specified, then close each entry partially on the quantity of contracts specified.

Navigation menu