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 Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        558 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        324 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        101 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        545 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        547 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X