Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

No Connection Lost Email

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

    No Connection Lost Email

    Hi
    I receive Connecting and Connected Emails but no Disconnection email.
    Below is my code:

    protectedoverridevoid OnConnectionStatus(ConnectionStatus orderStatus, ConnectionStatus priceStatus)
    {
    if (dataFeed == ConnectionStatus.ConnectionLost)
    {
    SendMail(
    "[email protected]", "[email protected]", "Connection to Order Server Lost!", "Please verify that the server's internet connection is still valid");
    PlaySound(
    @"C:\Program Files\NinjaTrader 7\sounds\Alert4.wav");
    }
    if (dataFeed == ConnectionStatus.Connecting)
    {
    SendMail(
    "[email protected]", "[email protected]", "Connecting", "Trying to reestablish Order Server connection");
    PlaySound(
    @"C:\Program Files\NinjaTrader 7\sounds\Alert4.wav");
    }
    dataFeed = orderStatus;
    if (dataFeed == ConnectionStatus.Connected)
    {
    SendMail(
    "[email protected]", "[email protected]", "Connected", "Check that strategy is active");
    PlaySound(
    @"C:\Program Files\NinjaTrader 7\sounds\Alert4.wav");
    }
    }

    #2
    Hello bbucha_stk,

    dataFeed == ConnectionStatus.ConnectionLost

    This only checks for disconnections that happen with no user interaction. If you manually disconnect, it won't send.

    It's hard then to test sending an email since you need an internet connection but need someway to force a disconnection with yahoo.

    PlaySound should work, and maybe add a print statement. Then, drop your internet connection by pulling plug or kill the connection through windows.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Agreed on the test for disconnect. But is there another alert/monitoring where my data feed provider has loss connection with me, but I still have internet availability?

      Comment


        #4
        Yes, that will test the connection specific to the data provider. If there is an unexpected disconnection but you still have internet, then it will send email. It's just difficult to create this scenario. f you had another provider with a 3rd party API, consider killing task on the API.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thanks...Thats What I was looking for

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by GussJ, 03-04-2020, 03:11 PM
          11 responses
          3,229 views
          0 likes
          Last Post xiinteractive  
          Started by andrewtrades, Today, 04:57 PM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by chbruno, Today, 04:10 PM
          0 responses
          7 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          441 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          12 views
          0 likes
          Last Post FAQtrader  
          Working...
          X