Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is there a way to simulate a data provider connection loss?

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

    Is there a way to simulate a data provider connection loss?

    Hello,

    Is there a way to simulate a data provider connection loss without manually disconnecting my internet connection?

    Is there code that I can temporarily add that forces a data connection loss without terminating the strategy?
    I have the strategy's ConnectionLossHandling set to KeepRunning.

    I am trying to simulate a message being sent by a strategy when the ConnectionStatus.ConnectionLost state occurs.

    If I disconnect my internet, NT8 cannot resolve the SMTP host and server to send the message.

    I am getting the "error sending a mail message" message, so I think it is working, but I would like to test it.


    Thank you for any info.

    #2
    Hello 9817_dynamic,

    Thank you for your post.

    You could use a program such as Microsoft's TCPView that lets you sever specific connections to simulate this. This is publicly available here:



    You'd want to look for NInjaTrader in the list, right click on a NinjaTrader Connection and click on Close Connection to test - there's usually a couple, so it may take a bit of trial and error to get the correct one.

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

    Comment


      #3
      I didn't even think of a third-party solution. I was looking for something inside NT8.

      Thank you very much for the info and suggestion!

      Comment


        #4
        Your suggestion to use TCPView worked very well, NinjaTrader_Kate. Thank you again!

        Comment


          #5
          Originally posted by NinjaTrader_Kate View Post
          Hello 9817_dynamic,

          Thank you for your post.

          You could use a program such as Microsoft's TCPView that lets you sever specific connections to simulate this. This is publicly available here:

          https://docs.microsoft.com/en-us/sys...nloads/tcpview

          You'd want to look for NInjaTrader in the list, right click on a NinjaTrader Connection and click on Close Connection to test - there's usually a couple, so it may take a bit of trial and error to get the correct one.

          Please let us know if we may be of further assistance to you.
          I'm testing this on a vps, so I can't simulate the disconnect manually.

          I tried to close the connections with this software but those auto-update quickly. I was able to cut the connection with the firewall (candles stop loading by cutting the connection to Ninjatrader.exe), but Ninjatrader doesn't take it as a disconnection, nothing happens in the log. Should I cut the connection to a particular port ? Is there any other way to do it? Thank you

          Comment


            #6
            Hello rocker84,

            Thank you for your reply.

            Unfortunately I'm not aware of another way to simulate a connection loss. There may be third party applications that could do this but I'm not aware of any particular one.

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

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, 03-13-2026, 05:17 AM
            0 responses
            87 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            151 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            80 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            53 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            62 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X