Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

if I need to have a bool called from an indicator to stay valid

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

    if I need to have a bool called from an indicator to stay valid

    for 5 bars irrespective of what it may actually be in the indicator for those 5 bars, how do I actually go about achieving that?

    I am asking this question because if I am in a trade and it so happens that I exited that trade 2 bars after the bool became true AND there was an opportunity to enter a new trade but the bool was no longer valid because the position was not flat at the time the bool became valid.

    Regards

    Kay Wai

    #2
    Kay, it sounds like you would then need a second bool that tracks only the bars elapsed since it became valid / true?

    Comment


      #3
      Hi Bertrand,

      would you mind providing an example of what you mean?

      From the little that I understand, if the first bool changes, the second bool would change too, no?

      Regards

      Kay Wai

      Comment


        #4
        Not necessarily Kay, consider the example where for example bool2 flips to 'true' if bool1 is true and then you track the barnumbers and set bool2 to false after your 5 bars. This would not 100% track bool1 but be what seek I believe from my understanding so far.

        Thanks,

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        649 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        576 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X