Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Counting elapsed bars

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

    Counting elapsed bars

    Is there a simple way to count bars forward after a given event or condition? Something similar to BarsSinceEntry() would do, but not specific for an entry event. For example, it should be able to be used in the following scenario: "If condition X is true, perform action Y while elapsed bars since condition became true is less than Z."

    #2
    Originally posted by fizikz View Post
    Is there a simple way to count bars forward after a given event or condition? Something similar to BarsSinceEntry() would do, but not specific for an entry event. For example, it should be able to be used in the following scenario: "If condition X is true, perform action Y while elapsed bars since condition became true is less than Z."
    Yeah, this sounds very easy.

    Do you need help coding it or something?

    Comment


      #3
      I expect it should be easy, but I'm asking here since I'm still getting familiarized with the built-in NinjaScript functions. Is there some bar counting function I overlooked, or do I need to code this myself? Which function(s) would be useful here?

      Comment


        #4
        fizikz, you can take a look at the MRO / LRO methods for this type of task -

        Comment


          #5
          Thanks, that's perfect.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by sjsj2732, Yesterday, 04:31 AM
          0 responses
          31 views
          0 likes
          Last Post sjsj2732  
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          286 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          283 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          133 views
          1 like
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          91 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Working...
          X