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

Data Mine

Indicator Bot

Process Definition

Process Output

Output Dataset Folder

Output Dataset

Output Dataset

Process Dependencies

Status Dependency

Data Mine Data Dependencies

Bot Data Dependencies

Data Dependency Folder

Data Dependency

Data Dependency

Status Report

Execution Started Event

Execution Finished Event

Product Definition Folder

Product Definition

Dataset Definition

Record Definition

Record Property

Formula

Calculations Procedure

Procedure Loop

JavaScript Code

Procedure Initialization

JavaScript Code

Data Building Procedure

Procedure Loop

JavaScript Code

Procedure Initialization

JavaScript Code

Product Definition

Plotter

Plotter Module

Plotter Panel

Panel Data

Data Formula

Shapes

Chart Points

Point

Point Formula

Polygon

Polygon Condition

Polygon Vertex

Polygon Border

Style

Style Condition

Style

Polygon Body

Style

Style Condition

Style

Image

Image Condition

Image Position

Text

Text Condition

Text Position

Text Formula

Text Style

Data Mine

A data mine is a hierarchy that contains definitions of sensor and indicators bots, and their 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 mines node menu in the Superalgos Project hierarchy.

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. Products are the outcome of the work produced by these algorithms, in the form of ellaborate data sets.

Most of the behavior expected from an indicator bot is defined by the structure of nodes in the hierarchy and the references among the nodes within these definitions. As such, you do not need to code any of the functions that make up the infrastructure functionality. Dependencies, outputs, data structures, execution sequences, and several other problems are handled by the definitions embodied in the structure of nodes that make up an indicator, and are configured in the visual environment of the design space. Coding is limited to the actual calculation and data building procedures.

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": "Superbot"
}
  • 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.

The Multi-Period-Market process deals with time frames of one hour and above. Because these time frames produce relatively small numbers of records, the process builds one single file per time frame spanning the whole market history—hence the name Multi-Period-Market.

On the other hand, the Multi-Period-Daily process deals with time frames below one hour. These time frames produce huge numbers of records, therefore, the corresponding data must be fragmented in multiple files. The Multi-Period-Daily process builds one file per day for each time frame—hence the name Multi-Period-Daily.

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"
    }
  }
  • codeName is the name of the process as used within the code of the system.

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 Folder

An output dataset folder is an organizational device used to create arrangements of output datasets, particularly useful when the bot has many products.

In cases in which a single bot has many different products, output dataset folders may help organize the outputs referencing each product, making their management easier. Folders may be nested like folders in the file system.

The use of output dataset folders is optional, as product definitions may also exist outside of folders.

Adding an Output Dataset Folder Node

To add the output dataset folder node, select Add Output Dataset Folder on the parent node menu.

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

Output datasets may be added in bulk, for all defined products, or one by one.

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

If you have defined multiple products, each with their dataset definitions, and wish to create all corresponding output datasets in bulk, select *Add All Output Datasets” on the process output menu. The system maps the product definition folder structure with output dataset folders, creates all required output datasets, and establishes the references with the corresponding dataset definitions, with a single click of the button.

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 its 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-OHLCVs 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 single data dependency, select Add Data Dependency on the process dependencies, bot data dependencies, or data dependency folder node menus.

In cases in which multiple data dependencies must be established, you may use the option to create data dependencies in bulk:

  • The Add All Data Dependencies option on the data mine data dependencies node menu adds a bot data dependency for each bot in the data mine, and a data dependency for each dataset definition or each product of each bot. You may use this option after manually adding a data mine data dependencies node and manually establishing the reference with the desired data mine, or after adding all data mine data dependencies, by which the references with data mines are established automatically.

It is unlikely that a bot requires numerous data dependencies, thus, the most common scenario is setting up individual data dependencies and establishing references manually. However, if your bot requires multiple data dependencies, the bulk features may be quite useful, as you may create all data dependencies for any given data mine, and simply delete those that are not required.

Data Mine Data Dependencies

Data mine data dependencies are references established with entire data mines to facilitate establishing data dependencies with multiple datasets in the given data mine.

The node may be used as an organizational device, simply to arrange bot data dependencies. However, the smart use of the node involves automating the deployment of multiple data dependencies and their references.

Adding a Data Mine Data Dependencies Node

To add a data mine data dependencies node, select Add Data Mine Data Dependencies on the parent node menu. This action adds the node but does not establish a reference with any data mine.

The smarter use of the node involves using the Add All Data Mine Dependencies option on the parent node menu. This action creates a data mine data dependencies node for each data mine in the workspace, establishing a reference with the corresponding data mines. This is the first step in the direction of quickly setting up multiple data dependencies when needed.

Bot Data Dependencies

A bot data dependencies node is an organizational device used to arrange data dependencies corresponding to a specific bot.

The device exists as an offspring of a data mine data dependencies node, and does not require a reference to a bot in the given data mine.

Adding a Bot Data Dependencies Node

To add the bot data dependencies node, select Add Bot Data Dependencies on the parent node menu. When adding a bot data dependency in this manner, the node does not inherit any particular label. In fact, it may even host data dependencies pointing to other data mines.

The bot data dependencies node may also be created automatically. When created using the Add All Data Dependencies option on the data mine data dependencies node, the node inherits the label of the corresponding bot in the corresponding data mine.

Data Dependency Folder

A data dependency folder node is an organizational device used to map the arrangement of product definition folders of a given bot.

The use of product data dependency folders is optional, as data dependencies may also exist outside of folders.

Adding a Data Dependency Folder Node

To add the data dependency folder node, select Add Data Dependency Folder on the parent node menu.

The data dependency folder node may be added automatically when using the Add All Data Dependencies option on the data mine data 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.

In the context of a trading process instance running a trading session on the network hierarchy, the execution started event may be used to force the trading process to run only after the last indicator bot dependency finishes its job. This guarantees that all dependencies are up to date and that the trading bot will evaluate the information corresponding to the same candles for all indicators used by the trading system.

Not setting up this event on a trading session may result in eventual data inconsistencies, as—in theory—the trading bot may run with some indicators up to date and some slightly delayed.

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 Folder

A product definition folder is an organizational device used to create arrangements of product definitions, particularly useful when the bot has many products.

In cases in which a single bot has many different products, product definitions folders may help organize those products, making their management easier. Folders may be nested like folders in the file system.

The use of product definition folders is optional, as product definitions may also exist outside of folders.

Adding a Product Definition Folder Node

To add the product definition folder node, select Add Product Definition Folder on the parent node menu.

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": "Product-Name",
  "singularVariableName": "productName",
  "pluralVariableName": "productNames"
}
  • 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 many 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",
    "timeFrames": {
      "filePath": "",
      "fileName": ""
    }
}

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"
    },
    "timeFrames": {
      "filePath": "",
      "fileName": ""
    }
}
  • 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.

  • timeFrames sets the name and path of the file indicating which time frames shall be filtered when the users sets a time frames filter.

Record Definition

The record definition is where indicators define how many properties, what properties and in which order those properties will be made available 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.

Typical dataset file showing records as arrays.

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 property is a piece of information that may be stored as part of the dataset or made available as a calculated property.

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

Formulas may use both the record and the variable objects made available by the calculations procedure and the data building procedure (see procedure loop).

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

The calculations procedure processes information to be fed to calculated properties. Calculated properties are not stored in the data set; instead, they are calculated in real-time as the data is consumed by others.

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 not. It is up to the developer to decide, but it is certainly not required.

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.

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.

Adding a Plotter Node

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

Configuring the Plotter

Select Configure Plotter on the menu to access the configuration.

{
  "codeName": "Plotter-Name"
}
  • codeName is the name of the plotter as it is used within the bot’s code.

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 the rendering of the corresponding polygon on and off.

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.

Image

The image node allows overlaying an image over the charts, controlling its position, size, and when it shall be rendered.

The foremost requirement for images is that they are in the png format, 24 bits, with transparency, a low case extension, and are square.

If you envision contributing your indicator so that the community may use it, then please follow the guidelines in the contribute icons page, in particular, the Technical Requirements.

Images must the stored in the following path: \BackendServers\WebServer\Images\Icons\style-01

Adding an Image Node

To add the image node, select Add Image on the parent node menu.

Configuring the Image

Select Configure on the menu to access the configuration.

{ 
   "codeName": "imagename", 
   "size": 15
}
  • codeName is the name of the image, without the .png extension.

  • size is the size at which the image shall be rendered, in pixels.

Image Condition

An image condition is a rule that allows establishing when an image shall be rendered and when not.

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

Adding an Image Condition Node

To add the image condition node, select Add Image Condition on the parent node menu.

Image Position

The image position node is a reference to a point defined in the chart points, and serves to determine the position in which the image shall be placed.

The image position node works similarly to the polygon vertex in the sense that it must establish a reference with a point in the charts point to acquire a defined coordinate that determines where the image shall be placed.

Adding an Image Position Node

To add the image position node, select Add Image Position on the parent node menu.

Configuring the Image Position

Select Configure on the menu to access the configuration.

{ 
   "offsetX": 0,
   "offsetY": 10
}
  • offsetX is an offset in the X axis, in pixels, applied to displace the image in relation to the coordinate point defined by the reference of the node. Negative values displace the image to the left and positive values to the right.

  • offsetY is an offset in the Y axis. Negative values displace the image downwards and positive values displace the image upwards.

Text

The text node allows overlaying text on the charts, controlling its position, size, appearance, and when it shall be rendered.

The node’s offspring control the different aspects of how, where, and when text shall be rendered over the charts.

Adding a Text Node

To add the text node, select Add Text on the parent node menu.

Text Condition

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

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

Adding a Text Condition Node

To add the text condition node, select Add Text Condition on the parent node menu.

Text Position

The text position node is a reference to a point defined in the chart points, and serves to determine the position in which text shall be rendered.

The text position node works similarly to the image position node in the sense that it must establish a reference with a point in the charts point to acquire a defined coordinate that determines where the text shall be placed.

Adding a Text Position Node

To add the text position node, select Add Text Position on the parent node menu.

Configuring the Text Position

Select Configure on the menu to access the configuration.

{ 
   "offsetX": 0,
   "offsetY": 10
}
  • offsetX is an offset in the X axis, in pixels, applied to displace the text in relation to the coordinate point defined by the reference of the node. Negative values displace the text to the left and positive values to the right.

  • offsetY is an offset in the Y axis. Negative values displace the text downwards and positive values displace the image upwards.

Text Formula

The text formula determines the content that shall be rendered over the charts.

The text formula may use any of the variables available to the plotter, and may produce either a numeric or a text string result.

Adding a Text Formula Node

To add the text formula node, select Add Text Formula on the parent node menu.

Text Style

The text style is a definition of color, opacity, and font size that determines the appearance of the text to be rendered over the charts.
Adding a Text Style Node

To add the text style node, select Add Text Style on the parent node menu.

Configuring the Text Style

Select Configure on the menu to access the configuration.

{
        "paletteColor": "UI_COLOR.GREY",
        "opacity": 0.5,
        "fontSize": 10
}
  • paletteColor is one of the predefined colors available, as described in the configuration of the Style node.

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

  • fontSize is self explanatory too; values above zero produce the expected results.