Much of the power of the P/L module derives from the notion of an order block. An order block consists of a set of trade orders (buy, sell, and/or exit) and conditions. The trade orders are ‘placed’ when the conditions are satisfied.
In one query, there can be many order blocks. This flexibility allows construction of complex queries covering numerous orders, securities, and strategies. In fact, order blocks can reference each other so that the behavior of one order block influences the behavior of another. This would allow, for example, a query that might switch between trend and counter-trend trades based on the nature of the market.
XMIM identifies orders and order blocks by unique labels. One order block can reference any other order block via the labels. The order and order block labels are assigned default numeric values by XMIM. These labels, however, can be changed by modifying the appropriate label field.
To create another order block, from the menu bar select Tools>Add Query Block>Order.
Placing an order is not always the same as executing the order. Conditional orders (limit, stop, trailing stop, profit objective, time delayed orders, etc.) require additional events to occur before a placed order is executed. This distinction between placing and executing an order provides flexibility and power in designing queries. |
The following example shows a simple two order block query for buying and selling US.
1: ORDER
1.1: Buy 1 contract of US
Enter on the close
WHEN
Date is after 1/1/1980
AND
US crosses above 30 day average of US
EXIT individual
US crosses below 30 day average of US
2: ORDER
2.1: Sell 1 contract of US
Enter on the close
WHEN
Date is after 1/1/1980
AND
US crosses below 30 day average of US
EXIT individual
US crosses above 30 day average of US