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 05-11-2012, 02:01 PM   #1
fercho
Member
 
Join Date: May 2011
Posts: 51
Thanks: 7
Thanked 1 time in 1 post
Default Post market order

Hi, I'm trying to figure out how Ninja could put a buy market order in the spain post market.

Spain´s post market starts at 17:30 (spain time) and ends 17:35.

The price traded at post market it's the close price of session.

For any condition, for example if lastest Close at time 17:29 (just before the post market) cross above SMA(20) enter long and send a market order in the post market.

Ninja could do that? I'm losting my life traying to get work out, but since Ninja calcs prices with bar close, and during the post market there´s no incoomming ticks sounds impossible (the last tick will be at 17:35 when final price is fixed during the 5 minutes post market ).

And CalculateOnBarClose = false, the order will be sent anytime when an incomming tick arrives during 17:29 and 17:30 but not at post market.

Any idea?

Thanks.
fercho is offline  
Reply With Quote
Old 05-11-2012, 02:19 PM   #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 fercho,

You could work with custom events like a timer to submit orders outside of OnBarUpdate(). This sample can help you work with timer objects.
http://www.ninjatrader.com/support/f...ead.php?t=5965

Keep in mind that if there is no bar update received, the simulator (Sim101 account) can't fill the order.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 05-11-2012, 02:30 PM   #3
fercho
Member
 
Join Date: May 2011
Posts: 51
Thanks: 7
Thanked 1 time in 1 post
Default

so, if there's no incomming tick (like the post trade sessions) ninja could however send a market order for example:

If (ToTime(Time[0]) == ToTime(17, 30, 01))

EnterLong(1000,"Long");

just using a time condition?

or Ninja must receive a tick to understand the current time?

Thanks
fercho is offline  
Reply With Quote
Old 05-11-2012, 02:41 PM   #4
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

For the current time, you'd want to use your computer clock instead of the bar time stamp. That's available with DateTime.Now

If there's no trades, then you'd need to add a custom event that submits orders outside of OnBarUpdate(). You can use the timer object from that reference sample to raise an event every second that checks DateTime.Now for an order condition.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 05-11-2012, 03:07 PM   #5
fercho
Member
 
Join Date: May 2011
Posts: 51
Thanks: 7
Thanked 1 time in 1 post
Default

Sorry It's very advanced code for me. Could just paste an example on how to do it?

It will simplify a lot my learning. Thanks in advance.
fercho is offline  
Reply With Quote
Old 05-11-2012, 03:47 PM   #6
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

Yes, I understand it can be tricky, but the sample linked is the best way to see a working example of it with all the parts integrated within one script.

If you have do not have the programming experience required to integrate the sample concepts into your own strategy, you can always consider contacting one of our 3rd party NinjaScript consultants:
http://www.ninjatrader.com/partners#...pt-Consultants
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
Adapt eSignal-NT interface to make use of eSignal's pre-/post-market US stock data AnotherTrader Suggestions And Feedback 3 03-26-2013 08:37 AM
EMA off sometimes, question about pre and post market data usage jkmott59 Indicator Development 3 03-29-2012 09:13 AM
Regular Session vs Pre and Post Market cuccaa Charting 0 12-26-2010 07:47 AM
Pre-Market and Post-Market data Federico Charting 6 12-21-2009 07:18 AM
The T&S window shows the daily close price in post market Pete S Historical NinjaTrader 6.5 Beta Threads 4 03-19-2008 09:24 AM


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