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 Mindset, 04-21-2026, 06:46 AM
          0 responses
          50 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          69 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          36 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          97 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          60 views
          0 likes
          Last Post PaulMohn  
          Working...
          X