You can use the “Set of Conditions (Combined with AND/OR)” expression to create a set of conditions that return true or false as a group based on the interplay between what each condition returns and how the conditions are combined together with ANDs, ORs, and parentheses.
When “AND” is used between two conditions, both of them must be true for the combined condition to be true.
When “OR” is used between two conditions, the combined condition is true if either one of the conditions is true.
“(“, or “the left parenthesis”, allows you to mark the beginning of multiple conditions that should be determined to be true or false as a group.
“)”, or “the right parenthesis”, allows you to mark the end of multiple conditions that should be determined to be true or false as a group.
Using left and right parentheses allows changes to the normal order of operations that is used to evaluate multiple conditions that are combined together using ANDs and ORs.
For your safety, it is highly advised to use parentheses when using both AND and OR in the same “Set of Conditions (Combined with AND/OR)” expression. Specifically, you should place the parentheses such that ANDs and ORs are never mixed together in either the same set of parentheses or in the top level of the “Set of Conditions (Combined with AND/OR)” expression that may be outside of any parentheses. This ensures that the order in which the AND’ed and OR’ed conditions are combined together and evaluated will be exactly what you would expect based on a quick visual inspection of the “Set of Conditions (Combined with AND/OR)” expression in the Quagensia® Desktop Application’s user interface.
“Set of Conditions (Combined with AND/OR)” expressions can be used in any location where a Boolean expression is expected, not just as the main condition expression of a Conditional Trading Logic action, a “Do Once If” action (Quagensia T Edition only), or a loop action. For instance, you can set the value of a Boolean internal variable to the result of a “Set of Conditions (Combined with AND/OR)” expression or you can pass a “Set of Conditions (Combined with AND/OR)” expression into a Boolean input parameter of a Quagensia Function.
You don’t even need to explicitly add a “Set of Conditions (Combined with AND/OR)” expression to use one, since whenever you add any kind of Conditional Trading Logic action, a “Do Once If” action (Quagensia T Edition only), or a loop action to your algo, the condition expression of the action is a “Set of Conditions (Combined with AND/OR)” expression by default.