NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 08-07-2009, 05:01 PM   #1
Parv8
Junior Member
 
Join Date: Nov 2008
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
Default Exit On Close

I am using strategy to exit my positions on close but somehow its failing to do so for last few sessions. Can someone advise what can be the cause and how to sort this out. Thanks.
Parv8 is offline  
Reply With Quote
Old 08-10-2009, 02:21 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,013 times in 994 posts
Default

Parv8, which NinjaTrader version are you using? You can check under Help > About. Also, which markets and ExitOnClose settings (seconds) are you using? Did you already try synching up your PC clock, rebooting fresh and then rechecking the issue?
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 08-10-2009, 02:45 AM   #3
Parv8
Junior Member
 
Join Date: Nov 2008
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi Bert, I am using 6.5version. I am trading USA markets with 1 min EOD settings. I never had such problem but for last two sessions. PC clock is synched with USA time. Will check again today.
Parv8 is offline  
Reply With Quote
Old 08-10-2009, 05:27 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,013 times in 994 posts
Default

Thanks for the reply, please ensure you're on the latest 6.5.1000.11 release. In case the orders did not reach the exchange in time, please try a higher ExitOnClose seconds setting such as 90 - 120.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 08-13-2009, 10:58 PM   #5
eleven
Member
 
Join Date: May 2009
Posts: 81
Thanks: 1
Thanked 1 time in 1 post
Default Same issue

I have the same issue. I have checked my clock (it's fine) and am running 6.5.1000.11. I have exit on close = true at 30 sec.

I have included a picture. Chart "1" is the realtime strategy (generated with historical data) at EOD (last bar closes 30min past session close). You can see the exit on close order was not issued. Chart "2" is the historical backtest with the exit on close issue issued.

Any ideas? I'm developing another strategy that I believe, but not confirmed, am seeing the same behavior. (I got an "exit" alert at session open 6:30 AM PST this morning which shouldn't happen with that strategy.)

I will try setting to 90 - 120 seconds to see if that helps. I'm running sim account so am I correct in that it will not matter?
Attached Images
File Type: jpg exitonclose.jpg (44.1 KB, 24 views)
Last edited by eleven; 08-13-2009 at 11:01 PM.
eleven is offline  
Reply With Quote
Old 08-14-2009, 05:11 AM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,013 times in 994 posts
Default

eleven, no the account should not matter - please try using a higher seconds setting and also upgrading to our latest 6.5.1000.12 release via Help > Download Site.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 08-14-2009, 07:57 AM   #7
eleven
Member
 
Join Date: May 2009
Posts: 81
Thanks: 1
Thanked 1 time in 1 post
Default

Thanks Bertrand. I will give that a try. As always, I appreciate the prompt reply.
eleven is offline  
Reply With Quote
Old 08-19-2009, 04:33 PM   #8
sharpie
Member
 
Join Date: Jul 2009
Location: Victoria BC
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
Default Same Issue (exactly) as "Eleven".

I am in the same camp. Strategy fails to exit on close. Running 6.5.1000.12. I have extended close seconds to 120. No difference. Like the other posters, my pc syncs regularly with Internet time. Am running in Sim account.

Thx in advance.
sharpie is offline  
Reply With Quote
Old 08-20-2009, 07:09 AM   #9
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,013 times in 994 posts
Default

sharpie, any errors listed in the Log tab of the Control Center as this 'fails' to exit on close?
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 08-20-2009, 11:02 AM   #10
sharpie
Member
 
Join Date: Jul 2009
Location: Victoria BC
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
Default

No errors in the log
sharpie is offline  
Reply With Quote
Old 08-20-2009, 11:06 AM   #11
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,013 times in 994 posts
Default

Please contact me using the Help > Mail to Support feature (attn Bertrand) and include the trace and logs for review - thanks
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 08-21-2009, 07:44 AM   #12
sharpie
Member
 
Join Date: Jul 2009
Location: Victoria BC
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks, I got your reply. I added the code to control ExitOnClose programatically. That will work, but it still does not explain why the NT feature does NOT work.

Is there any consequence to Exiting a position that does not exist? i.e. ExitLong, but I do not have a long position?

Yes, I use Vista 64, and yes NT 6.5 does not "support" it. It means, rather, that it does not avail itself of the benefits of 64 bit processing. 32 bit applications run without issue on Vista 64, as far as I know and from anything I have read on the matter.

Any comment on the code I pasted in at the bottom of the log file?

Thx
sharpie is offline  
Reply With Quote
Old 08-21-2009, 07:48 AM   #13
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,013 times in 994 posts
Default

sharpie, as noted in the email 64 bit operating systems are not supported with NinjaTrader 6.5 - since your ExitOnClose never triggered, please do recheck the entered Session times on the chart you're running the strategy on as ExitOnClose is tied to those, thanks.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 08-21-2009, 08:10 AM   #14
sharpie
Member
 
Join Date: Jul 2009
Location: Victoria BC
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
Default

The entered session time is 6:30 AM (local PC time). I change the begin and ending session times on the chart to 6:30 AM and 1:00 PM. Makes no difference if I do or do not. We can consider the topic closed. Maybe NT 7 will make a difference. I am not deterred from going forward.

Rather than making anotherr post I have one more question. It seems basic, but I am stumped.

I bought my "live" license a couple of days ago, updated the license number on NT. Connected to IB, turned on ATI.
Now I want to make a trade, say a manual trade, through IB, but the only account I can get access to is the Sim account. How do I activate the IB account?
sharpie is offline  
Reply With Quote
Old 08-21-2009, 08:13 AM   #15
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,013 times in 994 posts
Default

sharpie, please go to the File menu and uncheck 'Global Simulation Mode', then the live account should become accessible from the order entry windows.
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exit-on-close handling initiated after market close tooearly Automated Trading 3 08-05-2009 08:07 AM
Exit on close? Folls ATM Strategies (Discretionary Trading) 4 07-02-2009 07:34 AM
Enter at Close, Exit next day Close tjendra Strategy Development 3 04-08-2009 11:33 AM
Exit on close starrynight Automated Trading 12 01-15-2009 05:59 AM
Exit On Close TraderGuy Strategy Development 15 01-07-2009 02:10 AM


All times are GMT -6. The time now is 06:48 PM.