Creating and Editing Rules

Every hedge rule contains three components: If, Then, and Else. The If and Then components are required for every formula, while the Else component is optional. When creating a formula, you need to drag formula blocks into each section to create the logic and actions for the formula.

Tip: If you place blocks in the wrong order, you can rearrange them by dragging them to another position within the same section. For example, if you place the > block after the Value block, you can just drag it between the Field and Value blocks.

• To create an if-then rule using ticks away

To help you understand how to use the formula blocks, this procedure walks you through the process of creating the If section for a formula. In this example, you create a rule that triggers to send a notification when the number of ticks a legged order is away from the market exceeds five.

To create an If-Then rule using Ticks Away:

1. Open the Hedge Rule Builder window.

2. Click and drag the Field block to the If section. The Field dialog appears.

Field dialog box

3. In the Field drop-down, select Ticks Away; click OK. The TicksAway building block is added to the If section.

Hedge Rule Builder window

4. Click and drag the > block to the If section.

Hedge Rule Builder window

5. Click and drag the Value block to the If section. The Value dialog appears.

Value dialog box

6. Enter a value, and click OK. The value is added to the formula. The If condition is complete.

Hedge Rule Builder window

7. Click and drag the Action block to the Then section, and set the values as shown:

Action dialog box

8. Click OK. The green background indicates the formula is valid.

Hedge Rule Builder window

You successfully created an If-Then rule using Ticks Away.

• To create a generic rule not tied to a specific spread

You can use this procedure when you want to create a rule that is not tied to a specific spread shown in the Hedge Manager window.

To create a generic rule not tied to a specific spread:

1. From the Hedge Manager window, click the Hedge Rule Builder icon. The Hedge Rule Builder window appears.
2. Specify the If condition by dragging blocks into the field. The following example uses several building blocks to create a compound condition that triggers only when an order is legged for more than five seconds and is more than five ticks away from the market.

Hedge Rule Builder window

3. Specify the Then condition by dragging blocks into the field. This example uses a Payup action of one tick that repeats once and flashes a notification.

Hedge Rule Builder window

4. If desired, specify the Else condition by dragging blocks into the field.
5. If the formula status is valid, click OK.

You successfully created a generic rule not tied to a specific spread.

• To create a formula for a specific spread

You can also use the Hedge Rule Builder to create a formula for the rule of a specific spread in the Rules section of the Hedge Manager window.

To create a formula for a specific spread:

1. In the Hedge Manager window Rules section, right-click and select Add Rule from the context menu.
2. In the rule row, specify values for the Spread and Leg fields.
3. In the rule's row, select Custom from the Trigger drop-down. The Edit and Formula fields are enabled.

Hedge Manager window

4. Click the Hedge Rule Builder icon for the rule. The Hedge Rule Builder window appears.

5. Specify the If condition by dragging blocks into the field. The following example sets the If condition to TicksAway > 8.0.

Hedge Rule Builder window

6. Specify the Then condition by dragging blocks into the field. In this example, you nest an additional If-Then block to react differently based on how long the order has been legged.

Hedge Rule Builder window

7. Complete the logic for the nested If-Then block:
• For the If section, check to see if the order has not been legged for five or more seconds.
• For the Then section, pay up one tick.
• For the Else section, cross the market.
8. If desired, specify the outer Else condition by dragging blocks into the field. In this example, you leave the section blank.
9. If the formula Status contains Valid Formula (the entire background is green), click OK.

Hedge Manager window

You successfully created a formula for a specific spread.