Try TT Now

Autospreader

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.

Blocks

Description

Conditionally executes a statement depending on the value of an expression. Use this to create more complex nested rules.

Example: IF Time>5000[ms] THEN Payup [Tick 1, Payup 0] ELSE CrossInside

Use the parentheses to build a rule with multiple operators.

Example: (Ticks Away > 5)

Note: All values in parentheses will be evaluated first.

Use this to execute a statement that does not satisfy a condition. In the example below, the statement is valid if the AskPrc is less than or equal to 5.

Example: NOT (AskPrc > 5)

Use this to form a logical conjunction of two expressions.

Example: (Ticks Away > 5) AND (Time>5000[ms])

Use this to form a logical disjunction of two expressions.

Example: (Ticks Away > 5) OR (Time>5000[ms])

Less than operator.

Example: Ticks Away < 5

Less than or equal to operator.

Example: Ticks Away <= 5

Greater than operator.

Example: Ticks Away > 5

Greater than or equal to operator.

Example: Ticks Away >= 5

Equal to operator.

Example: Ticks Away == 5

Not equal to operator.

Example: Ticks Away <> 5

Addition operator.

Example: Ticks Away + 2

Subtraction operator

Example: Ticks Away - 2

Multiplication operator.

Example: Ticks Away * 2

Division operator.

Example: Ticks Away / 2

Use this to differentiate adding or subtracting based on hedge orders that are buys or sells.

For more information, refer to Formula Building Blocks

Use this to differentiate greater than or less than based on hedge orders that are buys or sells.

For more information, refer to Formula Building Blocks

Contains market prices and quantities from the hedge leg that can be incorporated into a formula rule.

For more information, refer to Hedge Leg Fields.

Use this to enter a time in milliseconds that can be incorporated into a formula rule.

Example: Time>5000[ms]

Use this to enter a value that can be incorporated into a formula rule.

Use this button to specify an action to take when the condition is true.

For more information, refer to Available Actions.

 

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.

Loads a rule from your rules library to the canvas.

Accepts or cancels the rule.