Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Count++ Stack and Kill Bool Variables

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Count++ Stack and Kill Bool Variables

    Summary: Seeking Guidance on locating appropriate script library references to the following object / method behaviors...

    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!

    #2
    Hello johnMoss

    From your description you would need to make that logic yourself, I am not aware of something prebuilt that would have the exact conditions you wanted already programmed into it. You could use an int variable and increment it as your conditions become true. Once it needs reset you could do that by making a condition that determines when the variable needs reset and set it back to 0.

    Comment


      #3
      Copy that thanx...

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      672 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      379 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      111 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      575 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      582 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X