4.6.1 Orders: Difference between revisions
From MultiCharts
no edit summary
(Created page with "Order objects can be created and generated only by signals. All orders inherit from the basic interface. <syntaxhighlight> public interface IOrderObject { int ID { get; } ...") |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 39: | Line 39: | ||
'''Order objects are created only in Create() method using OrderCreator:''' | '''Order objects are created only in Create() method using OrderCreator:''' | ||
1) ''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> | 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) ''IOrderMarket OrderCreator.MarketThisBar(SOrderParameters orderParams);'' - creates a Market order that should be sent on the Close of the bar where it 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) ''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> | 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) ''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> | 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) ''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> | 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: | The following structure is used to create an order object in all the '''OrderCreator()''' methods: | ||
Line 58: | Line 58: | ||
Settings: | Settings: | ||
* ''EOrderAction:'' | * ''{{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. | Buy – long position entry (buying). If the short position is currently opened, then it will be closed and the long one will be opened. | ||
Line 68: | Line 68: | ||
BuyToCover – short position exit (buying). This order cannot be sent, if the short position is not opened. | BuyToCover – short position exit (buying). This order cannot be sent, if the short position is not opened. | ||
* ''Contracts:'' | * ''{{Color|Blue|Contracts:}}'' | ||
Default – the quantity of contracts is calculated, according to the strategy settings in Strategy Properties window. | Default – the quantity of contracts is calculated, according to the strategy settings in Strategy Properties window. | ||
Line 76: | Line 76: | ||
name – Custom name of the order. | name – Custom name of the order. | ||
* ''OrderExit:'' | * ''{{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. | 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. | ||
Line 84: | Line 84: | ||
FromEntry(IOrderObject entry) – closes the particular entry, in the entry setting, created earlier, in the same signal. | FromEntry(IOrderObject entry) – closes the particular entry, in the entry setting, created earlier, in the same signal. | ||
[[Category:.NET | [[Category:4. Understanding PowerLanguage .NET]] |