Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator, resumption from suspension

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

    Indicator, resumption from suspension

    Hi,

    I have a few indicators I have added sound / voice announcements too. This is all great and works fine. For the most part, I leave IsSuspendedWhileInactive = true, except in special cases where I need it off for specific reason, to preserve resources. One issue I have, is that when the tab is re-selected and the indicator catches up, I can get a batch of announcements.

    So, my question is, is there a way to tell if the indicator is not realtime, and is in catch up mode, so I can skip them? I'd normally use State = State.Realtime, but I and not sure it works in these cases?

    Thanks.

    #2
    Hello pjsmith,

    Thank you for your post.

    Would you be able to provide a basic version of your script for us to test and ensure that you're seeing expected behavior (though it sounds likely that you are)? We may be able to better ascertain a potential resolution. You may remove any code unnecessary to reproduce.

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      Hi - Well, I can reduce it to something _really_ simple. Assume Suspendwhileinactive = true and indicator is run onBarUpdate

      Code:
      OnBarUpdate()
      {
               DoSomthing();  // how do you ensure this does not run when the indicator catches up, after it has been suspended?
      }
      Does that make sense?

      Comment


        #4
        Hello pjsmith,

        Thank you for your reply.

        We've found a resolution for this.

        If you check:

        Code:
        if (CurrentBar == Bars.Count - 2)
        {
             //alerts go in here
        }
        This only occurs when the indicator is actively processing. If CurrentBar doesn't equal Bars.Count - 2, the indicator is playing catch-up.

        Please let us know if we may be of further assistance to you.

        Comment


          #5
          Much appreciated. I will test over weekend. Happy Friday

          Comment

          Latest Posts

          Collapse

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