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

NT freezes for 20 seconds when placing orders

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

    NT freezes for 20 seconds when placing orders

    My code for entry submision looks like the following
    When executed live, it'll hang NT (hourglass) for about 20 seconds.
    Other info ..
    - You hear the order pending msg - entry order sent to IB
    - freeze
    - then the alert shows, along with it's sound
    - then the stop is placed

    FWIW, the email is never recieved (addr in the example is dummied out)

    Also .. which SMTP servers is this using, as I never saw anyplace to configure mine in NT



    Code:
    PBLow = Low[1] - 2*TickSize; 
    Print("PBLow");Print(PBLow);
    DrawArrowUp("My up arrow" + CurrentBar, 0, Low[0] + -2 * TickSize, Color.Yellow);
    EnterLong(DefaultQuantity, "S2L");
    Alert("S2Long", NinjaTrader.Cbi.Priority.High, "Reached Breakout", "C:\Data\SOUNDS\cowbell.wav", 10, Color.Lime, Color.Black);
    SendMail("[email protected]", "[email protected]", "Trade Alert", "Buy ");

    #2
    imported post

    First check our logs. Is there some funny stuff in?

    Next, let's make sure you do something like this in your strategy (I suppose this is strategy which you would not want to backtest but just run live):
    Code:
    if (Historical)
     return;

    Comment


      #3
      imported post

      Yeah, Now that I look I see an error connecting to your SMTP server.

      Error on calling 'OnBarUpdate' method for strategy 'S2': Error connecting to server. 81.169.163.72

      This reminds me of previous trouble ticket I opened ..
      That server is not reachable via SMTP from here.
      My guess is that the ISP is blocking it as part of their antispam efforts.
      Is there anyway to config NT to use my server? It would have to support SMTP authentication.


      No, this is a live and historical strat.
      A previous answer from Ray said that alert/email etc were ignored during historical runs and I didn't have to do any special testing

      Comment


        #4
        imported post

        zoltran wrote:
        No, this is a live and historical strat.
        A previous answer from Ray said that alert/email etc were ignored during historical runs and I didn't have to do any special testing
        That is correct. However my approach was about eliminating potential trouble causes.

        Will think about the mail problem and let you know.

        Comment


          #5
          imported post

          2 different issues:
          - next NT update will submit mail in a differemnt thread and thus avoid any mail related lockup
          - next NT update will support configurable mail SMTP server (Tools->Options)

          Comment


            #6
            imported post

            Thank You Dierk

            Pls ensure the smtp function supports smtp authentication.
            Many providers need this now.

            Comment


              #7
              imported post

              Yep, will do.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by GussJ, 03-04-2020, 03:11 PM
              15 responses
              3,271 views
              0 likes
              Last Post xiinteractive  
              Started by Tim-c, Today, 02:10 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Taddypole, Today, 02:47 PM
              0 responses
              2 views
              0 likes
              Last Post Taddypole  
              Started by chbruno, 04-24-2024, 04:10 PM
              4 responses
              51 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by TraderG23, 12-08-2023, 07:56 AM
              10 responses
              403 views
              1 like
              Last Post beobast
              by beobast
               
              Working...
              X