![]() |
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 |
|
Senior Member
Join Date: Jan 2009
Posts: 156
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
I have a strategy that has day bars as its primary, but uses minute bars internally for some actions (mostly, stop loss management). When I start the strategy, I do not have the option of setting the session start and end? First, it tried to submit a market order several hours before the market opened. The order was rejected by MBTrading. The strategy is coded to only place orders based on daily bars -- but how do i get it to constraint its activities to market hours? Also, since I am using minute bars to manage my exit, how do i prevent it from reacting to after market data, since the session start and end is not available for me to configure during strategy startup? Thanks, Brandon |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,226
Thanks: 83
Thanked 333 times in 325 posts
|
Hello Brandon,
I suggest to take a look at the link below, which will provide information regarding a time filter to limit trading hours. http://www.ninjatrader-support2.com/...ead.php?t=3226
Jason
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jan 2009
Posts: 156
Thanks: 0
Thanked 0 times in 0 posts
|
So, basically, unless i explicitly code it not to do so, a strategy based on day bars is always going to execute trades in the pre-market. Seems crazy...
Why you would have session start and end time for minute bars, and then remove it for day bars with this result, is very puzzling. Im sure most people who create a strategy don't want it executing orders in the pre-market. |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Just use minute bars as primary or do what Jason stated. From a daily bar stand point there is no "session". It is just a bar as provided by the data provider. The strategy dialogue window does not know you have a secondary bar object in the wings.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jan 2009
Posts: 156
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks, i will try using minute bars as the primary and days as secondary - maybe that will fix it.
However, the big problem was that the system submitted an order based on the daily bars. All my order entry is off the daily bars, and it seems like it processed this before the market opened. In fact, they were submitted around 2am. Maybe im just mistaken and MBtrading would hold these orders properly until market opens? I'm not sure, as one of the orders was rejected by MBTrading as having an invalid TIF. Thanks |
|
|
|
|
|
#6 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
The order would have been processed on the close of the prior daily bar which can only happen on the 1st tick of the next daily bar. Will look into this further.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Jan 2009
Posts: 156
Thanks: 0
Thanked 0 times in 0 posts
|
Ok thanks. I started the strategy yesterday after market close, primarily because i knew a buy signal would be generated for today. It looks like around 2am NT generated a buy order to MBTrading. The signal would have been generated based on the closing price yesterday.
Any help you can give me understanding the order and timing of executions when using the daily bar would be helpful. Ultimately, I need signals generated off of yesterdays closing price to execute at the market open the next day. Thanks |
|
|
|
|
|
#8 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
bridenour,
If a signal was generated at 2am I am lead to believe that you had data coming in at 2am for your minute time frame. You are sending the orders from the minute time frame correct? If that is the case you really need to just add a time filter.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Jan 2009
Posts: 156
Thanks: 0
Thanked 0 times in 0 posts
|
I am only sending orders off of the day bars. Day is my primary bar configuration.
I just use the minute bars as part of a stop loss/exit strategy. When would i normally expect to receive the daily bars? When would a day bar normally generated a buy signal, if that is where i place it? I am going to implement the time filter also, but im concerned that is not going to address the day bar signal issue. |
|
|
|
|
|
#10 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Daily bars are built whenever your data provider offers that information. When NT receives a tick for that bar it plots it onto the chart. I am lead to believe that your next day's bar was created at 2am. As Ray mentioned, when you submit your order at the close of a bar it will execute at the open of the next daily bar. It seems to me the open of this next bar happened at 2am and that is what is causing you concern.
If you are submitting from the daily bars the time filter will not work.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Jan 2009
Posts: 156
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks for the reply.
It seems like, based on what you are saying, using the daily bars for an ATS just won't work with Ninja Trader. If there is no way to effectively control and ensure that orders are placed during market hours, that would seem to suggest the product just won't work for multi-day trading or trading based on daily bars (rather than intraday bars) . I use MBTrading, which based on my research is/was one of your well-supported execution brokers. I'm very surprised that such a broad category of functionality is not supported. I researched for a couple of weeks here and did not see anyone else mention this limitation, and yet, if this is indeed a limitation, i can't imagine how anyone could use the product for this purpose. For the system I'm automating, i can't move the entry signals to the minute bars, as they are fundamentally generated off of day timeframe conditions. |
|
|
|
|
|
#12 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Sure you can. In the daily tiime frame when you decide a signal, mark it with a temp variable. Then on the first time filterized minute bar submit that trade when temp variable is true. Reset temp variable to false. It will get you in at the same spot you hoped for otherwise.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#13 |
|
Senior Member
Join Date: Jan 2009
Posts: 156
Thanks: 0
Thanked 0 times in 0 posts
|
fair enough, good idea. i will try that.
be back in a few days
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Session Start/End Settings | boblin | Charting | 2 | 09-14-2010 03:44 AM |
| Session Time Problem | Freddie | Charting | 19 | 02-12-2010 01:59 PM |
| How to set session start/stop time in NS? | henry.omd | Strategy Development | 1 | 01-11-2008 02:31 PM |
| Changing Session Begins and Session Ends time | forexample | Charting | 1 | 10-21-2007 01:16 AM |
| Session Start/End Time | MindSabre | General Programming | 1 | 04-29-2007 12:29 AM |