Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

When to know when connection is lost

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

    When to know when connection is lost

    Hello,

    I have a problem with my timers that execute code when the connection has been lost. I need to know when I am losing connection.

    I know that OnConnectionStatus does exactly that but it seems to work only on strategy not indicators. Am I right and if yes how can I find out about connection status from an indicator?



    Many thanks for helping

    #2
    Originally posted by blar58 View Post
    Hello,

    I have a problem with my timers that execute code when the connection has been lost. I need to know when I am losing connection.

    I know that OnConnectionStatus does exactly that but it seems to work only on strategy not indicators. Am I right and if yes how can I find out about connection status from an indicator?



    Many thanks for helping
    Code:
    if (Bars != null
    && Bars.Count > 0
    && Bars.MarketData != null
    && Bars.MarketData.Connection.PriceStatus == Cbi.ConnectionStatus.Connected
    && Bars.Session.InSession(Bars.MarketData.Connection.Now, Bars.Period, true, Bars.BarsType))
    {
    //you are connected, and are in an active session
    }
    Last edited by koganam; 07-29-2015, 12:28 PM.

    Comment


      #3
      Thank you very much Koganam.
      That surely solves my problem !

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      162 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      313 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      245 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      350 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      179 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X