Available translations

Style Condition

foundations.png
style-condition.png
A style condition is a rule that allows applying an alternative style in cases where the rule validates true.
Content
Style conditions offer a way to introduce additional intelligence on the visual representation of data by using styles that respond to certain conditions.
For example, the Percentage Bandwidth plotter module assigns a different color to the Moving Average line when it's going up or down.
To do that, a style condition features it's own style so that, when the condition validates true, the new style is applied.
Style conditions me be created in a sequence so that the style may continue changing upon the validation of a series of style conditions. The system evaluates all style conditions in a sequential order determined by their position in the rotational symmetry around the parent node. Each condition that is met may modify or add up to the resulting style that is rendered on screen. That is, the final style is the result of the sequential application of the styles defined for each condition that is met, on top of the default style.
Configuring
Style Condition Configuration
Style conditions work pretty much like conditions used on trading systems. The main difference is that the variables available are solely those provided by the bot product definition that reference the corresponding plotter module.
To continue the example of the Percentage Bandwidth plotter, the following is the condition that determines the newly added styles:
 record.previous.movingAverage > record.movingAverage
As hinted earlier, when the condition is met, the default style is modified by a second style that may be created on the menu of the style condition node.
The definition of secondary styles is slightly different from that of the default style, as—in such cases—the atMousePosition property may no longer be defined:
 {
    "opacity": 0.55,
    "lineWidth": 1,
    "lineDash": [0,0],
    "paletteColor": "UI_COLOR.RED"
}
Style Condition Menu
The Style Condition node has the following Node Menu items:
The Edit menu item has the following properties:
  • action: Edit
  • actionFunction: uiObject.codeEditor.activate
  • label: Edit
  • iconPathOn: javascript-code
  • iconPathOff: javascript-code
The Add Style menu item has the following properties:
  • action: Add UI Object
  • disableIfPropertyIsDefined: true
  • propertyToCheckFor: style
  • actionFunction: payload.executeAction
  • label: Add Style
  • actionProject: Visual-Scripting
  • relatedUiObjectProject: Foundations
The Delete menu item has the following properties:
  • action: Delete UI Object
  • actionProject: Visual-Scripting
  • askConfirmation: true
  • confirmationLabel: Confirm to Delete
  • actionFunction: payload.executeAction
  • label: Delete
  • iconPathOn: delete-entity
  • iconPathOff: delete-entity
Style Condition Children
The Style Condition node has the following childrenNodesProperties:
The Style node property features the following properties:
  • name: style
  • type: node
  • autoAdd: true
Style Condition Attaching Rules
The following are the Node Attaching Rules that govern the attachment of Style Condition with other nodes:
Compatible Types:
Style Condition Code
This section explores Style Condition Node Code.
Initial Value
The initial value for Style Condition Code is:
 ""
Examples
This is a list of examples used on the Style Condition code, collected from this workspace.