SUPERALGOS GOVERNANCE

Quantum/Arborist(QA) Team Proof of Value, October 2022

Adding further insight to indicators.

quantum8
Superalgos | Algorithmic Trading

--

Photo by David Pisnoy on Unsplash

After many weeks of testing, theblockchainarborist and I have finally released a much needed visual improvement to the indicator panels on the charts!

The Situation

Using the Text Style node for Indicator panels in Superalgos, one could only display the colour and text size in a static manner; that is once it’s defined, the value displayed on the indicator panel is locked to that colour unless changed at the node definition.

What if you could change this formatting in a dynamic way, changing its output the way the plotter does?

The Remedy

Introducing a new node type for the Panel Data; Panel Data Javascript Code!

Adding this node to the Panel Data, you can now use Javascript code to dynamically change the formatting of the value, as well as the label text!

Note: This node type cannot be used at the same time as the Text Style node, as it replaces and enhances the functionality there!

For a basic rundown on information needed to get the node to function, check out the documentation page within Superalgos!

Dynamic Panel Data Documentation Page

Setting up a dynamic format

To set this up, navigate to your indicator’s plotter node and follow this through to the Plotter Panel and the Panel Data.

This example comes from the “Trends” data mine; the Keltner Baseline Indicator.

Hovering over the Panel Data Node, there will be a new entry; Add Javascript Code:

Add Javascript Code Button

Hover over the newly added node and click on the edit button to bring up the editing dialogue:

Your Code goes here.

As an example for this indicator, the code added checks for the trend data and sets the various format parameters based on which direction the trend is:

if (record.trend == 1) {
textColor = UI_COLOR.DARK
valueColor = UI_COLOR.TURQUOISE
textSize = 16
valueFontSize = 16
textOpacity = "1"
valueOpacity = "1"
} else if (record.trend == -1) {
textColor = UI_COLOR.DARK
valueColor = UI_COLOR.PINK
textSize = 16
valueFontSize = 16
textOpacity = "1"
valueOpacity = "1"
} else {
textColor = UI_COLOR.DARK
valueColor = UI_COLOR.GREY
textSize = 16
valueFontSize = 16
textOpacity = "1"
valueOpacity = "1"
}

The conditional statement here is a simple, but effective example!

Note: all six parameter keys must be returned to have a fully functioning and formatted panel.

The output for the indicator can be seen when moving the mouse over the various candles. Notice how all the values change colour, matching the colour of the Keltner basis line!

Dynamic changes!

The label text can also be changed to whatever you wish, along with the font size and opacity!

End Notes

We trust this will be a valuable addition to the considerable work done by the SA and data mining teams! Let us know if there’s any further improvements that can be implemented in this area, we’re sure the best is yet to come.

Come and visit us in the chat channels!

--

--