NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


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 06-09-2011, 09:59 AM   #1
zerosum666
Junior Member
 
Join Date: May 2009
Posts: 28
Thanks: 2
Thanked 0 times in 0 posts
Default Enter Order on Close of the Session

Hi

I need to automate an order entry at the close of the session, which ideally would be right the opposite of the "ExitOnClose" instruction.

I am not finding a solution that effectively triggers the order everyday at the (close - n) seconds.

I am wondering if you can shed some light on what is the best approach to handle this?

The code runs in 10 minute bar aggregation and I want the order to be sent in the last few seconds of the session end, exactly in the same way the "ExitOnClose" instruction handles it.

Thanks
zerosum666 is offline  
Reply With Quote
Old 06-09-2011, 10:25 AM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hi zerosum666,

Unfortunately there is nothing built in to monitor for end of session. It must all be custom coded. You could work with time. If you are working historically, you can refer to bar's time stamp with Time[0]. For real time, the C# property DateTime.Now gets the time for your PC clock. Either of these can be checked for an entry condition.

http://www.ninjatrader.com/support/f...ad.php?t=19292
NinjaTrader_RyanM 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
Enter at Session Open upshon Strategy Development 1 01-03-2011 04:00 AM
Enter on Close gogetit Strategy Development 1 10-28-2010 03:00 AM
How can I enter at close of bar one and exit at close of session? stevep3 Strategy Analyzer 5 10-15-2010 04:49 AM
Enter at Close, Exit next day Close tjendra Strategy Development 3 04-08-2009 11:33 AM
How to enter market on close order? cunparis Strategy Development 1 10-06-2008 08:17 AM


All times are GMT -6. The time now is 11:44 PM.