Introduction
In the Quagensia® Desktop Application’s terminology, an “expression” is something that calculates a value or holds data, such as a calculation that returns a numeric value, a set of conditions that evaluates to true or false, a date, a piece of text, a color, or a list or array of 100 numbers.
On the other hand, in the Quagensia Desktop Application’s terminology, an “action” does something more than merely calculating a value or evaluating an expression. Examples of actions include submitting an order, drawing something on the chart, setting a variable, or executing code multiple times in a loop.
You can add an expression to your Quagensia Strategy or Function by clicking anywhere on the algo’s workspace where an expression is allowed, and then clicking one of the context menu items that adds an expression to your algo’s trading logic.
Some advanced actions can also be used in locations where expressions are expected. (Recommended for advanced users only)
Advanced users may occasionally want to create a Quagensia Expression Function, i.e. a function that returns an expression, and check the check box in the “Function Summary” section labeled “Can Be Used As An Action (Return Value Will Be Ignored When Used As An Action)” so that the Quagensia Function can be used both in a location where an expression is expected as well as in a location where an action is expected.
Quagensia Functions that do an action but can be used as an expression can be dangerous, because not all users will understand that something that they can place in a location where an expression is expected may also do something more than merely calculating a value or evaluating an expression like submit an order. For instance, if you create a Quagensia Expression Function that submits an order and then returns a Boolean (true or false) value that indicates if the order was submitted successfully and share this function with another user who thinks that the only way that an order could be submitted is by placing an action in a location in “When Bar Updates” where calls to order submission functions are usually placed, they may use the function in a location thinking that it will merely do a calculation and return an expression instead of submitting an order.
For your safety and for the safety of all users of any Quagensia Expression Function that can be used as either an expression or an action, please name your Quagensia Expression Function in a way that makes it clear that it does an action.