Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Kate W.NinjaTrader Customer Service

    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.
            Kate W.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by usazencort, Today, 01:16 AM
            0 responses
            1 view
            0 likes
            Last Post usazencort  
            Started by kaywai, 09-01-2023, 08:44 PM
            5 responses
            603 views
            0 likes
            Last Post NinjaTrader_Jason  
            Started by xiinteractive, 04-09-2024, 08:08 AM
            6 responses
            22 views
            0 likes
            Last Post xiinteractive  
            Started by Pattontje, Yesterday, 02:10 PM
            2 responses
            21 views
            0 likes
            Last Post Pattontje  
            Started by flybuzz, 04-21-2024, 04:07 PM
            17 responses
            230 views
            0 likes
            Last Post TradingLoss  
            Working...
            X