Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnConnectionStatus not firing

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

    OnConnectionStatus not firing

    When is this function supposed to fire ?

    Code:
    protected override void OnConnectionStatus(ConnectionStatus orderStatus, ConnectionStatus priceStatus) {
                Print(DateTime.Now + " ONCONNECTIONSTATUS " + orderStatus + " " + priceStatus);
    }
    i put this function into my strategy and i see no output ever

    #2
    Hi, it would fire for a change in your connection status - http://www.ninjatrader-support.com/H...ionStatus.html

    Comment


      #3
      i tried that. how do i manually get it to fire i need to test out some code.

      i tried disconnecting from TWS already and that didnt do anything

      Comment


        #4
        ok so i got the disconnect event by shutting down TWS. this was the only way i gott his event to fire.

        i tried unplugging my ethernet cable and the event did not fire.

        my main concern is if my internet connection goes out. is there a way i can detect if my system has lost its internet connection or trigger something in ninjatrader if the connection is lost?

        Comment


          #5
          clam61, please check this post and the snippet posted there and retry simulating the connection loss - http://www.ninjatrader-support2.com/...ad.php?t=16361

          Comment


            #6
            hi bertrand, you linked me to this thread

            Comment


              #7
              can you explain to me how i can simulate each connection state? connected, disconnected, etc.

              it seems fairly obvious but perhaps i am doing something wrong

              btw, i am using the reference example, OnConnection strategy

              Comment


                #8
                If you want to simulate connection loss please use a tool like tcpview to kill connections while you are running your strategy.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  my concern is that when my internet connection gets disconnected (like when i unplug my ethernet cable) no event gets triggered.

                  is this expected behavior?

                  Comment


                    #10
                    clam61,

                    To simulate a connection loss you would want to use tcpview. Events will trigger as NT recognizes a connection loss. If that green connected status remains green there will be no event.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      hi josh thanks for the advice.

                      i want to test under a real situation...when my strategy is live interrupts will not happen via tcp view.

                      anyways, the green indicator turns red, and i see no event when i unplug my cable.

                      Comment


                        #12
                        As far as connection drops go, only a utility like tcpview can emulate it precisely.

                        Check your Control Center logs for errors.
                        Josh P.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by charlesugo_1, 05-26-2026, 05:03 PM
                        0 responses
                        60 views
                        0 likes
                        Last Post charlesugo_1  
                        Started by DannyP96, 05-18-2026, 02:38 PM
                        1 response
                        145 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Started by CarlTrading, 05-11-2026, 05:56 AM
                        0 responses
                        161 views
                        0 likes
                        Last Post CarlTrading  
                        Started by CarlTrading, 05-10-2026, 08:12 PM
                        0 responses
                        97 views
                        0 likes
                        Last Post CarlTrading  
                        Started by Hwop38, 05-04-2026, 07:02 PM
                        0 responses
                        283 views
                        0 likes
                        Last Post Hwop38
                        by Hwop38
                         
                        Working...
                        X