Chart Logic is designed to make things as easy as possible. There is an incredible amount of complexity hidden by the application. There are some places where the behaviors make sense for the majority of cases, but if you find yourself pusing the boundaries of what's possible, you may find unexpected results. This post will clarify the behavior of one such case, in describing how singular Object Actions are updated.
Conditions and Actions
We all know by now that a Logic Set in Chart Logic contains Conditions and Actions, and when all of the Conditions are true, then all of the Actions are fired. This is the basis by which Chart Logic works.
And, well, it's not always true.
Specifically, Object Actions get a chance to take some action even if a condition in the Logic Set (or Set Condition) fails. Why? Because we might want to update some data that's being displayed on the charts when conditions fail.
Object Actions
Object Actions draw things on charts. Lines, boxes, text and so on. These objects are usually referring to variables that are being set and cleared by conditions. If I have a line that is displaying when some condition is true, then conversely I would want that line to stop being displayed when that condition is false. That's a general statement, and it falls under the category of "designed to make things as easy as possible" and "make sense for the majority of cases." You don't think about a line disappearing when the condition is no longer true, but in order for that to happen, the Object Action has to have an opportunity to run when a condition fails.
Creating Objects
The first time that all of the conditions in a logic set are true and the actions are being called, an Object Action will create its objects on the chart. This assumes the Object Action can obtain all of the data it's configured to use, meaning that all of the data it's trying to pull from variables is available. And the thread where it's running has to match the current chart symbol; we don't draw objects on other symbols' charts.
Updating Objects
After an object has been created, if any of the data changes that the object is referring to (e.g. a price or time variable used for the placement of the object), then that object will get the updated value and adjust itself accordingly, even if conditions failed in this cycle. The Object Action will only create new objects when all conditions are true, but once it's created, it will monitor the variables and update when they change, even if conditions are failing.
Removing / Hiding Objects
When a condition fails, if it is setting a variable, then it will clear its variable value from the variable space. This happens when a condition has expired; and if it's the condition's cycle, if it fails its evaluation. (Though note that a Price Condition behaves a little differentlly, only setting its value when the condition fails.)
And if that variable value is referenced by an Object Action, then that object will be hidden when it tries to access the variable value and finds that it's missing. If you want to force the object to be hidden when some condition fails that is not setting a variable that the object is using, then you can add a condition to explicitly unassign a variable value (the "=!" operator) to get the same result. You may have to combine this with other AND/OR/NOT tests to get the value to be cleared under the correct circumstances.
Summary
All conditions true: objects are created
All variables are available (even if conditions fail): objects are updated
Any variable is not available: object is hidden
While it is generally true that actions are only triggered when all conditions in the Logic Set / Set Condition are true, there is an exception for singular Object Actions getting updated even when conditions fail. Hopefully this explainer can avoid any confusion from Logicians who are experimenting with Chart Logic features and notice this possibly unexpected result.