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 rocketman7, Today, 02:12 AM
          7 responses
          28 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by guillembm, Yesterday, 11:25 AM
          3 responses
          16 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by junkone, 04-21-2024, 07:17 AM
          10 responses
          148 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by tsantospinto, 04-12-2024, 07:04 PM
          6 responses
          101 views
          0 likes
          Last Post tsantospinto  
          Started by trilliantrader, 04-18-2024, 08:16 AM
          7 responses
          28 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X