Sometimes its hard to find these as more precise search keywords i.e. correct nomenclature reference are unknown

Objective:
A series of different indicating methods will be used to fire individually assigned bool variables [their own name] on their own unique conditional accedance. A count begins as these bools fire true. The calculation will always fire on bar close, and some conditions may fire on the same bar. If/When respective conditions become true, a count is started which lasts for X bars, so for example the variable 'Condition A' becomes true, converts its assigned bool variable to true and remains that way & added to a collective bool count for no more than 7 bars, at which point (i.e. 7 bars later) it is removed from the active count.
Example starting with a zero count condition & 'X' bar count = 7:
[onBarClose] Count
If condition A = true then count is 1. String "Condition A" 1 ( 7 bars later 'A' = false; count reduced by one)
condition B = true then count is 2 String "Condition B" 2
condition C = true then count is 3 String "Condition C" 3
and so on...
Noted here also, and applying to this case, is that some conditions [A for example] may fire again while the 'existing true A condition' is still alive in its 7 bar time limit. I know what to do about that...
The majority of this I know how to write already but I'm seeking to avoid a small mountain of redundant code. So seeking script reference on this with the objective of radically simplifying the construct.
Thanx a bunch!

Comment