Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Connection lost

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

    Connection lost

    Good morning,

    Something unexpected happened this morning. NT has "lost connection" to IBs TWS but it was still receiving datafeed, so the charts were updating, but you could not place a trade on the chart.

    My strategy sends an email after each bar update, therefore I was receiving an email reassuring that the connection was ok, even though it wasn´t.

    How can I produce an alert via email whenever the connection to IBs TWS is lost? Can the entries in the log be sent via email?

    Thanks for any help,

    Best regards

    Juan Rivera

    #2
    Hi Juan, you could use OnConnectionStatus() with the SendMail feature for this task - http://www.ninjatrader-support.com/H...ionStatus.html
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi,

      I am no advanced programmer, but I will try to look into this...

      Meanwhile, and I know this is asking too much,... it would be nice to know the exact code I need in order to receive an email everytime the connection is lost... and another email everytime an order has been filled at the exchange...

      thanks a lot for any help

      best regards

      Comment


        #4
        For how to use OnConnectionStatus() please see the example in the Help Guide article Bertrand provided. All you need to do is add a SendMail() inside the if (dataFeed !=...) check.

        To get an email when an order is filled do this:
        Code:
        protected override void OnOrderUpdate(IOrder order) 
        { 
            if (order.OrderState == OrderState.Filled) 
            { 
                SendMail("[email protected]", "[email protected]", "SUBJECT", "BODY");
            } 
        }
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Is there any way to use an email notification whenever the strategy turns off because of an error of some sort ?

          For example, whenever my strategy submits a change request for a new limit price and by coincidence, my previous limit price is filled at the same exact time that the new one is submitted, I get an error message and the strategy STOPS.

          I need to know how to send an email notification whenever this happens so I can turn it back on.

          Thank you,

          Comment


            #6
            Hi dax3k, welcome to the NinjaTrader forums! Please check this link - http://www.ninjatrader-support.com/H...rHandling.html

            You can use SendMail to send a notification if your orderstate changes to 'rejected'...
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by srtrader, 02-12-2025, 09:01 PM
            3 responses
            23 views
            0 likes
            Last Post rockmanx00  
            Started by bertochi, Yesterday, 05:25 PM
            2 responses
            28 views
            0 likes
            Last Post bertochi  
            Started by sclay115, 02-10-2025, 03:58 PM
            6 responses
            30 views
            0 likes
            Last Post sclay115  
            Started by Babbou72, Today, 08:37 PM
            0 responses
            14 views
            0 likes
            Last Post Babbou72  
            Started by ethanguh, Today, 08:34 PM
            0 responses
            9 views
            0 likes
            Last Post ethanguh  
            Working...
            X