← Back to X_TRADER® Help Library

The Hedge Rule Builder Window

The Hedge Rule Builder window is where you construct and manage your rules. The following illustration and table describe the sections of the Hedge Rule Builder window.

• 1. Formula Building Blocks

The top section of the Hedge Rule Builder window contains the building blocks you can use to create formulas for your rules.

Note: Hedge Rule Builder uses the following precedence when evaluating rules with multiple operators:

1. Constant values, parentheses, negation operator (-), Time action
2. Multiplication and division operators (*, /)
3. Addition and subtraction operators (+, -, +/-)
4. Logical comparison operators (<, >, <=, >=, >/<)
5. Equality comparisons (==, <>)
• 2. Formula Canvas

The formula canvas provides the working area for your formula. You drag and arrange the formula building blocks into the different areas in the canvas until you create a well-formed formula. The initial canvas includes the following sections:

• If section, where you define the conditions that trigger the rule.
• Then section, where you define what actions to take when the If condition evaluates to TRUE.
• Else section, where you optionally define actions to take when the If condition evaluates to FALSE.

Tip: If you need to modify or delete an item on the canvas, you can right-click the item and select Modify or Delete from the item's context menu.

The following canvas shows a formula that uses only the If and Then sections.

Hedge Rule Builder canvas

The canvas uses the background color to indicate whether the current rule is valid formula. When a part of a rule contains a syntax or logic error, the canvas changes the background color to red for the rule and for the components that are invalid. For example, the red background in the following canvas indicates problems with the Then section, which also makes the entire rule invalid.

Hedge Rule Builder canvas

• 3. Formula Status

The Status area beneath the canvas updates the status of the formula as you build it. When the current state of a rule is complete and syntactically correct, the Status area shows Valid Formula; otherwise, it displays information explaining why the formula is not valid.

Example: Then >> Then must contain a single action or an If/Then/Else statement

• 4. Control Buttons

The bottom of the window provides buttons to manage the working formula and to access rules in the rules library.

ButtonDescription

Removes all blocks from the canvas.

Saves the current formula to your rules library.