![]() |
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
|
|||||||
| 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. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Member
Join Date: May 2011
Posts: 51
Thanks: 7
Thanked 1 time in 1 post
|
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. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
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.
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: May 2011
Posts: 51
Thanks: 7
Thanked 1 time in 1 post
|
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 |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
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.
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: May 2011
Posts: 51
Thanks: 7
Thanked 1 time in 1 post
|
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. |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
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
Ryan M
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |