Skip to main content

Automate trade order flow

You can automate the trade order flow with a decision table that sets rules with conditions and actions. For example, you can decide at what time (and how often) you will perform validations and bulking. You can also specify portfolio groups for manual check and bulking.

For more details on how to modify and deploy decision tables, refer to the Developer Guide:Create, deploy and verify a decision table

Trade order flow rules

Trade order flow is set up with the decisions table fa_tradeOrder_orderFlow.xlsx . This decision table contains the following rules:

  • RuleTable Open trade orders. If the parent portfolio belongs to a dynamic group called Manual order acceptance , the order receives a Manual acceptance-Waiting tag. By default, all orders in Open status go forward and change to Accepted if the order does not have a Manual acceptance-Waiting tag. If you need to define this step in instrument / trade order level (portfolio group is not insufficient), modify this rule: Open orders must be checked manually if their portfolio belongs to the Manual order acceptance group (the order receives the Manual acceptance-Waiting tag).

  • RuleTable Open trade orders (Order payment rules). If the account is missing or it is non cash account in purchase trade order (B,SUB), order will get a Payment-Waiting and Validation-Not needed tags. If you need to define these rules differently, modify rules in rule table called RuleTable Accepted trade orders (Order payment rules).

  • RuleTable Open trade orders (Pre-validation rules). By default, all buy and sell orders without Validation-Not needed tag will have Validation-Waiting tag. If you want validation for some orders to be skipped, add a new rule to the first in rule table RuleTable Open trade orders (Pre-validation rules). Action for this rule should be a new tag called Validation-Not needed: $t.setTag("$1");$t.setTags($t.getTags());update($t);

  • RuleTable Accepted trade orders (Limit check rules). This rule adds tag Limits-Waiting on Accepted orders with no tag in the Limits tag group.

  • RuleTable Accepted trade orders (Bulk rule). By default, all accepted orders whose parent portfolio belongs to a group called "Bulk" (and are paid and validated) receive a Bulk-Waiting tag. If you need to define this step in instrument / trade order level (portfolio group is not insufficient), modify these rules: Accepted / Paid / Validated buy orders should have Bulk-waiting tag, if parent portfolio belongs to group Bulk (B / SUB / S / RED).

  • RuleTable for Accepted trade orders. This rule table sets status to Accepted on orders which have Order validation tag Ok or Not needed, don't have Limits tag Fail or Waiting (i.e. their pre-trade limit check is not failed or pending) and don't have Payment tag Mismatch, Waiting or Sent (i.e. their payment is ok).

  • RuleTable for Executable trade orders. When accepted order is paid and validated (and not a part of bulk), the order status is changed to Executable. If you need to define extra steps / different rule for this, modify the rule table called RuleTable for Executable trade orders.

  • RuleTable for Trading Connector. Customise your rule for trading connector. Scheduled trade orders send is done with the orders, that have Trading-Waiting tag. Remember to add all the needed trading info (channel, identifier).

  • Optional rule for skipping manual order validation. An optional rule for skipping manual order validation. By default it is disabled. To use it, change column C to "ORDER" instead of "DISABLED".

Define which trade order tags can be mass-modified

Some trade order flow rules are based on trade order tags. You can assign a tag to trade orders automatically (with a decision table) or manually from FA Back (see Update trade orders). To make the manual option work, you need to list modifiable tags in the configuration:

  1. Go to ToolsAdministerData aggregation.

  2. Open the Mass-adjust trades tab. List the tags in the Comma-separated list of Trade order tags that are shown and modifiable via Mass-adjust trades process. For example: Trading status-Working,Trading status-Invalid.

Once you listed the tags in the configuration, they are shown in the Modify orders window – the users can assign or remove these tags from the trade orders.