A data mine provides the tools to build indicators, produce data visualization plotters, and process markets data, with minimal coding requirements.

Network

Network Node

Data Storage

Session Based Data

Session Reference

Single Market Data

Data Product

Session Independent Data

Single Market Data

Data Product

Data Mining

Task Manager

Task

Sensor Bot Instance

Sensor Process Instance

Market Reference

Key Instance

Indicator Bot Instance

Indicator Process Instance

Market Reference

Testing Environment

Task Manager

Task

Trading Bot Instance

Trading Process Instance

Market Reference

Backtesting Session

Paper Trading Session

Parameters

Base Asset

Quoted Asset

Time Range

Time Frame

Slippage

Fee Structure

Production Environment

Task Manager

Task

Trading Bot Instance

Trading Process Instance

Market Reference

Key Instance

Forward Testing Session

Live Trading Session

Parameters

Base Asset

Quoted Asset

Time Range

Time Frame

Slippage

Fee Structure

Data Mine

A data mine is a hierarchy that contains definitions of bots, including the trading bot, sensors, indicators, and even plotters. These definitions make up the actual programs of such bots—the source code.

In a way, data mines are catalogs of bots that anyone may create. This hierarchy provides all the tools required to create sensors, indicators, and plotters, with minimal coding required.

Because the hierarchy provides definitions, it does not intervene in the execution of bots. Instead, the definitions in data mines are instantiated from the network hierarchy by bot instances. Bot instances and process instances are the ones running the code according to the definitions in the corresponding data mine.

Adding a Data Mine Node

To add a data mine, select Add Data Mine on the workspace node menu.

Configuring the Data Mine

Select Configure Data Mine on the menu to access the configuration.

{
"codeName": "Supermine"
}
  • codeName is the name of the data mine as used within the code of the system.

Indicator Bot

An indicator bot is an algorithm that processes information that other bots have generated, and produces elaborate datasets for others to consume.

The indicator bot node holds all definitions required for an indicator bot to function. Definitions are split between the definition of processes and products. Processes are algorithms that go through an input dataset, perform certain calculations, and produce an output. Part of that output is the data products the bot creates.

Adding an Indicator Bot Node

To add an indicator bot, select Add Indicator Bot on the data mine node menu. An indicator bot is created along with the basic structure of nodes required to define it.

Configuring the Indicator Bot

Select Configure Bot on the menu to access the configuration.

{
"codeName": "Super",
"repo": "Super-Indicator-Bot"
}
  • codeName is the name of the bot as used within the code of the system.

Process Definition

The process definition node groups all definitions required for a process to function. The Multi-Period-Market Process deals with time frames of one hour and above. The Multi-Period-Daily Process deals with time frames of 45 minutes and below.

As hinted above, most bots, in particular indicators, have two different processes. The reason is that different data structures need to be handled in different manners. The Multi-Period-Daily process handles daily files, while the Multi-Period-Market process handles market files.

Adding a Process Definition Node

To add a process definition, select Add Process Definition on the bot’s menu. A process definition node is created along with the basic structure of nodes comprising the definition.

Configuring the Process Definition

Select Configure Process on the menu to access the configuration.

Multi-Period-Market:

  {
    "codeName": "Multi-Period-Market",
    "normalWaitTime": 0,
    "retryWaitTime": 10000,
    "framework": {
      "name": "Multi-Period-Market"
    }
  }

Multi-Period-Daily:

  {
    "codeName": "Multi-Period-Daily",
    "normalWaitTime": 0,
    "retryWaitTime": 10000,
    "framework": {
      "name": "Multi-Period-Daily"
    }
  }

Both configurations deal with certain aspects of the internal workings of these kinds of processes. In most cases, you may use the configuration as is.

Process Output

The process output groups the definitions of which datasets are impacted by the process, that is, which datasets the process builds or takes a part in building.

Adding a Process Output Node

To add a process output node, select Add Missing Items on the process definition node menu. Items that may be missing are created along with the basic structure of nodes required to define them.

Output Dataset

The output dataset is a reference to a dataset definition. By establishing such reference, the process acquires the definitions as of how the dataset is to be constructed.

There are other effects of establishing a reference from the output dataset to a product dataset definition. Upon execution, every time a process finishes a processing cycle, it triggers an event that may be consumed by other entities. This event indicates that the datasets impacted by the process have been updated.

An example of other entities that may be listening to such events is that of plotters. Plotters read datasets and create graphical representations of this data over the charts. Charts are constantly updating the information in the form of candles and indicators in realtime, synchronized with the data being extracted from the exchange by the sensor bot. That kind of automatism is possible thanks to the events that processes trigger every time an execution cycle is finished, signaling to everyone listening that new data is available on each of the impacted datasets.

Indicators-Process-Output-01

The image above shows the typical references from output datasets to datasets definitions.

Adding an Output Dataset Node

To add an output dataset, select Add Output Dataset on the process output node menu.

Process Dependencies

Process dependencies are references to various data structures on which the process depends to function.

While processes run autonomously, most processes participate in a value-adding chain by which a process produces a data product that other processes may consume as an input to be processed further. This means that bots—while autonomous in their particular jobs—do depend both on other bots and on the data other bots produce.

Adding a Process Dependencies Node

To add a process dependencies node, select Add Missing Items on the process definition node menu. Items that may be missing are created along with the basic structure of nodes required to define them.

Status Dependency

Status dependencies are references to a status report that define which process the process establishing the reference depends on.

The reference is established to acquire the information relative to what the target process is doing. For example, by reading a status report a process may learn when was the last time the referenced process ran, and what was the last file processed.

The status report referenced may belong to the same process— which is called a self-reference. In such a case, the process is learning what it did the last time it ran. Also, the status report referenced may belong to another process—another bot. In that case, the dependency may be of the Market Starting Point or Market Ending Point types.

  • Self Reference is mandatory, as a process needs to read it’s own status report every time it wakes up.

  • Market Starting Point is a status dependency existing on Multi-Period-Daily processes so that the process establishing the reference learns the datetime of the start of the market. Usually, the reference is established with the sensor’s Historic-Trades process status report. Multi-Period-Market processes do not have this type of status dependency as the date of the start of the market is implied in their dataset (a single file with all market data).

  • Market Ending Point is a status dependency existing both in Multi-Period-Market and Multi-Period-Daily processes so that the process establishing the reference knows the datetime of the end of the market.

Indicators-Process-Dependencies-01

The image above shows a case of a self-reference status dependency as well as a market ending point status dependency.

Adding a Status Dependency Node

To add a status dependency, select Add Status Dependency on the process dependencies node menu.

Configuring the Status Dependency

Select Configure Status Dependency on the menu to access the configuration.

{ 
"mainUtility": "Self Reference|Market Starting Point|Market Ending Point"
}
  • mainUtility determines the type of status dependency, with possible values being Self Reference, Market Starting Point, or Market Ending Point.

Data Dependency

Data dependencies are references established with dataset definitions of other bots, determining which datasets the process establishing the reference uses as input.

Most bots consume data other bots have produced. Because bots need the data as input for their calculations, processes establish a data dependency with the dataset definitions of other bots. The reference provides the process with all the information needed to decode the dataset, enabling it to perform the required calculations.

Indicators-Process-Dependencies-02

The image above shows data dependencies in one bot referencing dataset definitions of another bot.

Adding a Data Dependency Node

To add a data dependency, select Add Data Dependency on the process dependencies node menu.

Status Report

Status reports serve as temporal annotations that bots read every time they run to know what was done in the previous cycle and what the state of affairs is at present. Status reports are dynamic, and they change constantly, with updates after every cycle of the associated process.

Bots do not run continuously. Instead, they run in cycles. A cycle usually lasts until there is no more data to process, and once they finish, they shut down until the next cycle is due. A status report is a file every bot writes at the end of each cycle with information about the last run, including the datetime of the run and the last record processed.

A status report may be consumed by the same bot producing it, or by other bots.

Adding a Status Report Node

To add a status report, select Add Missing Items on the process definition node menu. Items that may be missing are created along with the basic structure of nodes required to define them.

Execution Started Event

The execution started event is the event that triggers the execution of a process. It usually references the execution finished event of another process on which the process depends on.

These references determine when a process is due for another run. By listening to the execution finished event of the process it depends on, it may wake up just in time to process the new batch of data the dependency has just delivered.

Bots form a sort of multi-branched execution sequence with an indeterminate number of dependencies. Every time the bot further down the tree of dependencies finishes a cycle, it triggers the execution of multiple bots listening to its execution finished event.

Adding an Execution Started Event Node

To add an execution started event, select Add Missing Items on the process definition node menu. Items that may be missing are created along with the basic structure of nodes required to define them.

Execution Finished Event

The execution finished event is the event that processes trigger once they have finished an execution cycle. The event is broadcasted to whoever wants to listen, so that other bots may know when the process has finished its execution cycle.

The execution finished event is responsible for triggering the execution of every process that depends on the data a bot produces. If bot Alice depends on bot Bob, Alice listens to the execution finished event of Bob so that it may start a new execution cycle as soon as Bob finishes its cycle. Alice listens to Bob’s execution finished event by establishing a reference from its execution started event.

Indicators-Process-Execution-Started-Finished-Events-01

The image above shows a reference established from the execution started event of a process to the execution finished event of another process.

Adding an Execution Finished Event Node

To add an execution finished event, select Add Missing Items on the process definition node menu. Items that may be missing are created along with the basic structure of nodes required to define them.

Product Definition

The product definition node holds all definitions that make up a product, including how the product is calculated and the datasets the product is comprised of.

A bot may feature multiple products, thus, there may be multiple product definitions. Three main aspects need to be defined in terms of products: the characteristics of the dataset, the composition of each record, and the way records are calculated.

Adding a Product Definition Node

To add a product definition, select Add Product Definition on the bot’s node menu. A product definition is created along with the basic structure of nodes required to make up a product.

Configuring the Product Definition

Select Configure Product on the menu to access the configuration.

{
  "codeName": "New-Product-Name",
  "singularVariableName": "newProductName",
  "pluralVariableName": "newProductNames"
}
  • codeName is the name of the product as it is used within the bot’s code.

  • singularVariableName is the singular form of the name of the variable representing the product, as is used on strategies (i.e.: bollingerChannel.direction, where bollingerChannel is the name of the product as defined in its configuration and direction is the name of the property.

  • pluralVariableName is the plural form of the variable.

Dataset Definition

A dataset definition contains a configuration file that defines all aspects of the dataset. There are two types of dataset definitions: Multi-Period-Market and Multi-Period-Daily.

A good part of what makes datasets easy to consume by other bots is the fact that they are standardized in terms of their structure. It is that structure that is specified in the dataset definitions.

Adding a Dataset Definition Node

To add a dataset definition, select Add Dataset Definition on the bot’s node menu.

Configuring the Dataset Definition

Select Configure Definition on the menu to access the configuration.

Multi-Period-Market:

{
    "codeName": "Multi-Period-Market",
    "type": "Market Files",
    "validTimeFrames": [ "24-hs", "12-hs", "08-hs", "06-hs", "04-hs", "03-hs", "02-hs", "01-hs" ],
    "filePath": "@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Product/@Dataset/@Period",
    "fileName": "Data.json"
  }

Multi-Period-Daily:

{
    "codeName": "Multi-Period-Daily",
    "type": "Daily Files",
    "validTimeFrames": [ "45-min", "40-min", "30-min", "20-min", "15-min", "10-min", "05-min", "04-min", "03-min", "02-min", "01-min" ],
    "filePath": "@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Product/@Dataset/@Period/@Year/@Month/@Day",
    "fileName": "Data.json",
    "dataRange": {
      "filePath": "@Exchange/@BaseAsset-@QuotedAsset/@DataMine/@Bot/Output/@Product/@Dataset",
      "fileName": "Data.Range.json"
    }
  }
  • codeName is the name of the dataset as used within the code.

  • type refers to the type of dataset; possible values are Market Files and Daily Files.

  • validTimeFrames refers to the time frames handled by the dataset.

  • filePath sets the path on which files are stored; the proper name of the data mine, the bot and the product need to be entered.

  • fileName sets the name of the files that constitute the dataset.

Record Definition

The record definition is where indicators define how many fields, what fields and in which order those fields will be stored in each record.

Bots store data in the form of arrays of records, in a minimized plain text file and the standard JSON format, although not as objects with named properties, but as arrays.

image

The choice of plain text for storage of large volumes of information has benefits in terms of not requiring any sophisticated technology to store and serve the data (i.e.: no database is required).

Best practice indicates that there needs to be a balance between the amount of data that is stored and calculations that may be performed at runtime.

Storing objects with named properties in the JSON format would be inappropriate as labels would repeat over and over, creating a ridiculous amount of unnecessary information. However, storing arrays in the JSON standard facilitates the handling of files in the context of JavaScript and Node.JS.

Adding a Record Definition Node

To add a record definition node, select Add Record Definition on the product definition node menu. A record definition node is created along with the first record property.

Record Property

A record is the compendium of information stored for each period of time, including the start and end datetime of the period along with the properties that provide the information the indicator is meant to generate.

Records may have as many properties as required.

Adding a Record Property Node

To add a record property, select Add Record Property on the bot’s node menu.

Configuring the Record Property

Select Configure Property on the menu to access the configuration.

{
  "codeName": "record-name",
  "isString": false,
  "isCalculated": true
}
  • codeName is the name of the record as it is used in the bot’s code.

  • isString determines if the field is a text string or if, in turn, is a numeric field. Dates are stored in the epoch format, which is numeric. The reason why this configuration is important is that fields that are strings need to be stored between “double quotes”.

  • isCalculated determines if the field is stored in the dataset or if, instead, is calculated at a later stage. A value true means that the record is not stored. In the case isCaculated is not defined in the configuration, it is assumed to be false.

Indicators-Record-Definitions-01

The image above shows a record definition with four record properties.

Formula

In the context of a record definition, formulas are used to assign a value to the property, usually in the form of a variable declared in the calculation or data building procedure.

A formula may act in slightly different ways depending on the isCaculated attribute in the record property configuration:

  • When a property is calculated ("isCalculated": true), the formula assigns to the property a value that is calculated in the calculations procedure. Even if the property is not stored in the dataset, it is made available as a calculated property to other bots that may have the dataset as input.

  • When a property is not calculated ("isCalculated": false or the attribute is not defined in the configuration) the formula is applied in the data building procedure.

Adding a Formula Node

To add a formula, select Add Formula on the record property menu.

Calculations Procedure

Bots store data in the minimized array format as a strategy to build the lightest possible datasets. For the same reason, a bot may choose not to store easily calculable information.

For example, imagine an indicator that stores buy and sell volumes… does it need to store the total volume? Given that it is so easy to calculate, the answer is probably no. IT is up to the developer to decide, but it is certainly not required.

The calculations procedure calculates the properties that the developer chose not to store in the dataset.

Adding a Calculations Procedure Node

To add a calculations procedure, select Add Missing Items on the product definition node menu. Items that may be missing are created along with the basic structure of nodes required to define them.

Procedure Loop

The procedure loop holds the JavaScript code that reads an input, processes the information, and generates an output recursively.

This is an example of a procedure loop code snippet, in particular, the code that calculates the Popular SMAs product of the Simple Moving Average (SMA) indicator.

/* Loop Code. */

let candle = record.current // Our main dependencies are candles 
variable.last200.push(candle.close) // Add the current close value to the last 200 array.

if (variable.last200.length > 200) {
    variable.last200.splice(0, 1) // Remove the first element of the array to keep it at a maximun of 200 elements.
}

variable.sma20 = calculateSMA(20)
variable.sma50 = calculateSMA(50)
variable.sma100 = calculateSMA(100)
variable.sma200 = calculateSMA(200)

function calculateSMA(periods) {  // Having a function saves us from duplicating code.
    /* We check we have enough values to make the calculation */
    if (variable.last200.length < periods) { return 0 } // If we dont, we define the value is zero.

    let sum = 0 // Initialize sum variable. 
    for (let i = variable.last200.length - periods; i < variable.last200.length; i++) { // Iterate through the last periods
        sum = sum + variable.last200[i]
    }
    let sma = sum / periods
    return sma
}

Adding a Procedure Loop Node

To add a procedure loop, select Add Procedure loop on the corresponding procedure node menu. A procedure loop node is created along with the corresponding JavaScript node.

JavaScript Code

The JavaScript code node may hold any snippet of valid JavaScript.

The system allows developers great flexibility as all valid JavaScript code is allowed.

Adding a JavaScript Code Node

To add a JavaScript code node, select Add Code on the corresponding parent node menu.

Procedure Initialization

The procedure initialization is used to initialize variables used by the procedure loop.

This is an example of a procedure loop code snippet, in particular, the code that initializes the array used in the calculation of the Popular SMAs product of the Simple Moving Average (SMA) indicator.

/* Initialization Code. */
variable.last200 = []

Adding a Procedure Initialization Node

To add a procedure initialization, select Add Procedure Initialization on the corresponding procedure node menu. A procedure initialization node is created along with the corresponding JavaScript node.

Data Building Procedure

The data building procedure processes information to be fed to properties that are stored in the output dataset.

This procedure holds the core logic of the bot, as it features the code that performs the calculations required to produce the new data set. The code is split between a procedure initialization and a procedure loop.

Adding a Data Building Procedure Node

To add a data buildings procedure, select Add Missing Items on the product definition node menu. Items that may be missing are created along with the basic structure of nodes required to define them.

Plotter

A plotter is a device used to produce a graphic representation of datasets generated by bots.

Plotters usually have a one-to-one relationship with bots, as they are often created as a customized solution. However, in practice, there is no constraint to creating any number of plotters for a single bot or a single plotter for multiple bots.

The overall workflow of a plotter, while reading a dataset, consists in:

  • Applying a set of rules to identify certain data points;

  • Use those points to form lines and polygons;

  • Apply graphical styles to those lines and polygons.

Those actions are performed recursively for each record, and the graphics are plotted on the charts in real-time as data is processed.

Plotter Module

A plotter module is a device within a plotter that contains the definitions to create the visualization for a product definition.

A single plotter may have several modules. Different modules may be used to plot each product of the bot, or as best suits the expected use-pattern.

Plotter-Module-01

Plotter-Module-02-Product-Link

Adding a Plotter Module Node

To add a plotter module, select Add Plotter Module on the plotter node menu.

Configuring the Plotter Module

Select Configure Plotter Module on the menu to access the configuration.

{
    "codeName": "Module Name",
    "isLegacy": true,
        "icon": "histogram"
}
  • codeName is the name used in the code to refer to the module.

  • isLegacy is true for plotters modules developed entirely in JavaScript, and is false or doesn’t show in the configuration for plotters built with the tools featured in the data mine hierarchy.

  • icon is the name of the image that illustrates the corresponding layer in the Layers Panel. In case the banner is not specified, the default banner is used. Current possible values are:

Value Image
default Default-Banner
histogram Histogram-Banner
band Bands-Banner
moving-average Moving-Average-Banner
oscillator Oscillator-Banner
trend trends-banner

Custom images may be added too. To do that:

  1. name the image in the following format: image-name.png;

  2. place images in the WebServer\Images\Icons folder;

  3. in the configuration of the module, use the name as is (e.g.: "icon": "image-name")

Plotter Panel

A plotter panel usually shows numerical representations of data over the charts on a small window or panel. The plotter panel node features definitions to make that possible.

Beyond the graphic representation of data over the charts, plotters may also feature a data panel, that is, a numerical representation of the data showing the exact figures corresponding to the column or period that is in focus (the point of the charts where the mouse pointer is at any point).

Adding a Plotter Panel Node

To add a plotter panel, select Add Plotter Panel on the plotter module node menu.

Panel Data

A panel data node represents a data field to be plotted on the plotter panel.

The system renders a panel featuring a centered, single-column vertical arrangement of data, with a label and a data field right below it. The label of each data field on the panel is given—by default—by the label set for each panel data node.

Adding a Panel Data Node

To add a panel data node, select Add Panel Data on the plotter panel menu.

Configuring the Panel Data

Select Configure Panel Data on the menu to access the configuration.

{
    "valueDecimals": 2
}
  • valueDecimals sets the number of decimals to be shown on the corresponding data field.

To override the default manner in which the data is assembled on the panel, the following properties may be included and defined:

{
    "labelText": "The Label",
    "labelPosition": 15,
    "valuePosition": 20,
    "valueDecimals": 2
}
  • labelPosition and valuePosition represent the vertical distance of the corresponding fields to the top margin of the panel.

Data Formula

A data formula is a device used to assign a value to the panel data, usually in the form of the name of the corresponding record property.

Adding a Data Formula Node

To add a data formula, select Add Data Formula on the plotter panel menu.

Shapes

The shapes node contains definitions of polygons and styles to be rendered on a per-period basis over the charts.

A plotter recursively renders graphics for each period or candle. This means that a definition of what shapes need to be drawn for a single period is required. The plotter does the same thing for every period or candle that is visible on the screen at any point in time, for any time frame, as long as the corresponding data is available.

Shapes-01-show-off

In general terms, the process of defining what is going to be rendered on the screen consist of the following four steps:

  1. Identifying points defined by [x,y] coordinates
  2. Defining polygons
  3. Defining default styles
  4. Defining conditional styles

Adding a Shapes Node

To add a shapes node, select Add Shapes on the plotter module menu.

Chart Points

A chart points groups definitions of coordinate points used to define polygons.

The definition of a point consists of the name of the point and the corresponding values for the x and y coordinates. To create such definitions, point and point formulas are used.

Adding a Chart Points Node

To add a chart points node, select Add Chart Points on the shapes menu.

Point

A point is a definition of an [x,y] coordinate. The value [x] usually represents a datetime. The value [y] may refer to a price or some other concept.

These coordinate points are used to define polygons. Values for [x,y]coordinates are entered with a point formula.

Adding a Point Node

To add a point, select Add Point on the chart points node menu.

Point Formula

A point formula is a node used to input the [x,y] coordinates of a point.

To represent some form of variation of the price or a price derivative over time, a typical point formula consists of the following two coordinates: x = datetime and y = rate.

For example:

Point SMA 20 Begin

x = record.begin
y = record.previous.sma20

The example above shows the definition of the first of two points necessary to draw the segment of the 20-periods SMA curve for any particular period or candle. In this case, x = record.begin is the starting datetime of the period and y = record.previous.sma20 is the rate of the 20-periods SMA of the previous period.

To complete the line segment corresponding to a single period, the closing datetime of the period and the closing rate for the 20-periods SMA are required:

Point SMA 20 End

x = record.end
y = record.sma20

The above system works very well for plotting all sorts of information over the candles, on the charts.

An oscillator like RSI too needs the definition of the starting and ending datetime of the period as the value for the x-axis. However, the value for axis y fits a different scale.

Anyway, the points definition is just as straight forward, for example:

Point RSI Begin

x = record.begin
y = record.previous.value

Point RSI End

x = record.end
y = record.value

Points do not necessarily need to refer to values on the dataset produced by the corresponding data product. For example, absolute values for the y-axis may be used to describe fixed graphical elements, for instance, a horizontal line, or a box.

Point Begin 20

x = record.begin
y = 20

Point End 20

x = record.end
y = 20

Point Begin 30

x = record.begin
y = 30

Point End 30

x = record.end
y = 30

The above four points are used to paint the background of the 20 to 30 value range of the RSI chart. The first two points are also used to draw the dotted line signaling the 20-value mark, and the last two are used for the dotted line indicating the 30-value mark.

Adding a Point Formula Node

To add a point formula, select Add Point Formula on the point node menu.

Polygon

A polygon features definitions that makeup shapes and their styles.

Polygons are defined by two or more vertices, which map points in a charts point. The graphic representation of polygons originates in styles applied to either or both polygon bodies and polygon borders.

Adding a Polygon Node

To add a polygon, select Add Polygon on the shapes node menu.

Polygon Condition

A polygon condition is a rule that allows establishing when a polygon shall be rendered and when not.

The node is optional. When the node is not present in the definition of the polygon or when the condition validates true, the polygon is rendered on screen. When the condition validates false the polygon is not rendered. As such, the node allows dynamically switching on and off the rendering of the corresponding polygon.

Adding a Polygon Condition Node

To add a polygon condition, select Add Polygon Condition on a polygon node menu.

Configuring the Polygon Condition

Select Edit Condition on the menu to access the configuration.

Polygon 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.

Polygon Vertex

A polygon vertex is a reference to a point defined in the chart points, constituting a specific coordinate to be used as a vertex of a shape.

Vertices are the main element defining polygons. Once created, each vertex must establish a reference to the corresponding point in the charts point.

Vertex-01-add-and-link

Drawing curves requires two vertices. Painting areas, such as the background of a chart, likely requires four vertices. Note that vertices are not capable of featuring a style. Instead, styles are applied to polygon borders and polygon bodies.

Adding a Polygon Vertex Node

To add a polygon vertex, select Add Polygon Vertex on the polygon node menu.

Polygon Border

A polygon border is a shape defined by at least two vertices used to draw lines or to apply a style to the stroke of a closed shape.

A polygon border needs at least two vertices to be defined. A border serves to create a stroke for the outlines of any sort of polygon, either closed or open, by giving it a style.

Adding a Polygon Border Node

To add a polygon border, select Add Polygon Border on the polygon node menu.

Style

A style is a definition of color and opacity in case of a polygon body, and color, opacity and line thickness in case of polygon borders.

A style applied to a polygon body or a polygon border node acts as the default style. Styles including colors, opacity, line width, and more, are defined in the node’s configuration.

Adding a Style Node

To add a style, select Add Style on a polygon border or polygon body node menu.

Configuring the Style

Select Configure Style on the menu to access the configuration.

A typical definition for a polygon body style looks like this:

{
    "default": {
        "opacity": 0.2,
        "paletteColor": "UI_COLOR.DARK_TURQUOISE"
    },
    "atMousePosition": {
        "opacity": 0.3,
        "paletteColor": "UI_COLOR.DARK_TURQUOISE"
    }
}

A typical definition for a polygon border style has a couple more properties:

{
    "default": {
        "opacity": 0.2,
        "lineWidth": 1,
        "lineDash": [0,0],
        "paletteColor": "UI_COLOR.DARK_TURQUOISE"
    },
    "atMousePosition": {
        "opacity": 0.3,
        "lineWidth": 2,
        "lineDash": [0,0],
        "paletteColor": "UI_COLOR.RUSTED_RED"
    }
}

The first section of the definition refers, as explicitly stated, to the default state of the style.

The second section refers to the style assigned to the column or period on which the mouse pointer is located. This is very useful for highlighting the specific zone of interest as the user browses the charts.

  • opacity is probably self-explanatory: it may range from 0 for a fully transparent object to 1 for a solid object.

  • paletteColor sets the color for the fill or stroke in cases of polygon bodies and polygon borders respectively. Use the variable UI_COLOR followed by a . and any of the properties in the following list for a selection of currently available colors:

Variable Value RGB Value Color Sample
DARK 48, 48, 54  
LIGHT 234, 226, 222  
GREY 150, 150, 150  
LIGHT_GREY 247, 247, 247  
WHITE 255, 255, 255  
BLACK 0, 0, 0  
GOLDEN_ORANGE 240, 162, 2  
RUSTED_RED 204, 88, 53  
GREEN 188, 214, 67  
RED 223, 70, 60  
PATINATED_TURQUOISE 27, 153, 139  
TITANIUM_YELLOW 244, 228, 9  
MANGANESE_PURPLE 91,80, 122  
TURQUOISE 74, 207, 217  
DARK_TURQUOISE 2, 149, 170  
  • lineWidth is the width of the border line, which should be greater than 0.

  • lineDash is used to turn the border into a dashed-line; the first value corresponds to the length of the dash while the second value defines the length of the space.

Style Condition

A style condition is a rule that allows applying an alternative style in cases where the rule validates true.

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.

Adding a Style Condition Node

To add a style condition, select Add Style Condition on a polygon border or polygon body node menu.

Editing a Style Condition

Select Edit Condition on the menu to access the 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"
}

Polygon Body

A polygon body is the fill of a shape made out of at least three vertices.

A polygon body needs at least three vertices to be defined. A body serves to create a fill for the outlines of any sort of polygon, either closed or open, by giving it a style.

Adding a Polygon Body Node

To add a polygon body, select Add Polygon Body on the polygon node menu.