PDA

View Full Version : NT freezes for 20 seconds when placing orders


zoltran
04-10-2007, 02:28 AM
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



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("wxxxxx@xxxs.com", "S2@winners.com", "Trade Alert", "Buy ");

NinjaTrader_Dierk
04-10-2007, 02:51 AM
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):
if (Historical)
return;

zoltran
04-10-2007, 03:05 AM
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

NinjaTrader_Dierk
04-10-2007, 03:12 AM
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.

NinjaTrader_Dierk
04-10-2007, 06:39 AM
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)

zoltran
04-10-2007, 06:54 AM
Thank You Dierk

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

NinjaTrader_Dierk
04-10-2007, 06:56 AM
Yep, will do.