![]() |
|
|||||||
| 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: Apr 2009
Posts: 114
Thanks: 0
Thanked 0 times in 0 posts
|
I was trying to turn on my first live trading strategy (Sunday morning) so it would start trading live when the market opens on Monday. I got the error: “unable to connect to order server”. I started a chat with MB Trading support and they said their live and demo servers were going to be turned on shortly at Sunday 4:59 pm EST. I asked when they turn them on and off and they replied, they are off from Friday at 5:01 pm EST - Sunday 4:59 pm EST. I want to turn on a strategy the places trades until all of the money in my account is in trades, periodically it looks for better positions to hold and sells the ill performing ones. So this is a strategy I want to leave running indefinably. Most positions are held (from back testing) 1 to ~3/5 months. I will make sure the strategy is flat the first time I start it with a date filter I have coded. After that it will be potentially be selling positions the first day of every month and buying the second day of every month (rebalancing). Since I will need to reboot my system periodically for software installs, and since I will be cut off from the order servers periodically with lost connections etc… I am trying to figure out how to best configure:
Thanks, Erik |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Erik, unfortunately first of all the following disclaimer has to be kept in mind when autotrading on the MBT connection - MB Trading position events are generated before orders are executed. Since NinjaTrader relies on execution events to come prior to position events, you will experience limitations with tracking positions from the Strategies tab of the Control Center and trying to rely on the standard sequence of events (order execution before position) in NinjaScript.
For your strategy setup 'immediately submit' is the correct option to pick up and not wait for a new signal, however the sync should be done then by as you manually as needed.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Dec 2008
Posts: 338
Thanks: 0
Thanked 0 times in 0 posts
|
Bertrand,
That being the case, is there any sync options that should be initiated as soon as a 'position event' is received from MBT ?? |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
I'm not following you Jon - the autosync options would not be applicable in this scenario since the strategies tab position reports could not be used to judge whether you're in sync or not.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Apr 2009
Posts: 114
Thanks: 0
Thanked 0 times in 0 posts
|
I am still a little confused on what to expect. Today is the first day of the month so I would expect my strategy will be placing market orders at the close of this bar. Will the orders be executed at tomorrow’s open?
What should I expect to see wrong in NinjaTrader because it is executing against MBT? Will my strategy not keep track of my positions and not close them? What will be wrong? What should I expect to see happen at the end of today and tomorrow morning? Thanks, Erik |
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Erik, the strategy should trigger tomorrow as the opening tick of the new day bar is received then. The trade order should execute correctly at MBT, but the strategies tab position shown can't be used to jusge whether or not it's in sync to the account begin executed to, as event ordering in which the events are received are mixed up.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Apr 2009
Posts: 114
Thanks: 0
Thanked 0 times in 0 posts
|
I am still not sure I fully understand the ramifications of the events firing out of order, but I have one computer running the strategy using IQFeed and the SIM account and another computer running the strategy against MBT live account so I guess the differences will become clear to me soon. Or at least I will have more questions :-)
Thanks, Erik |
|
|
|
|
|
#8 | |
|
Senior Member
Join Date: Dec 2008
Posts: 338
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
![]() I already test for iOrder != null, and cancel if order is open, before submit new order. I am wondering if same should be done for sENTRY != null as I have seen overfill notices in SIM on MB Trading. I understand I may be over reacting, so a response on whether a test such as this might cause problems with MB reporting is also appreciated. ... as in having partial fills of entrys or coversThanks for clarification, Jon
Last edited by Trader.Jon; 03-04-2011 at 04:14 PM.
|
|
|
|
|
|
|
#9 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
Jon, Bertrand will be back in on Monday and I will have him respond then.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#10 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Jon, I'm not following you - why are you attempting to test for any sync if you're working with a flat account and strategy position?
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#11 | |
|
Senior Member
Join Date: Dec 2008
Posts: 338
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
NT support has advised that the API from MB Trading sends position information before the entry is actually completed. ... your post here "event ordering in which the events are received are mixed up." ... re: IF I had submitted an order && position reported as no longer flat by MBT, but entry actually never completed before the new bar forms and another new order is sumitted, but there is an entry now made from the original order completed. Jon |
|
|
|
|
|
|
#12 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Jon, I'm sorry I do not follow you - the issue is: the position update will be send before the actual execution update which is from NT's point of view an 'illogical' event sequence which leads then to tracking issues.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#13 |
|
Senior Member
Join Date: Apr 2009
Posts: 114
Thanks: 0
Thanked 0 times in 0 posts
|
So is this a common problem with using NT againt MBT. My strategy put in an order to buy an ETF. I did not check all of my symbols and it turns out this ETF could not be purchased in mixed and/or or odd lots. So the order was rejectect my MBT and showed as a reqected order in the order book. I had exit on close set to true and at the end of the day my strategy tried to short the ETF. This order was rejected by MBT as well (a good thing since I did not want to short this ETF).
|
|
|
|
|
|
#14 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Hi Erik, would you mind sending the logs and traces for this one via Help > Mail to Support?
Thanks,
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#15 | |
|
Senior Member
Join Date: Dec 2008
Posts: 338
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
// OK :: // I FEEL that the following line is an invalid test of actual position with MBT because // it is potentially not correct (as in has invalid position information) and returns 'false' // even before the trade has been completed, as position info is received here before // the trade completion if (Position.MarketPosition == MarketPosition.Flat) // SO (I think) since I have orders managed within OnExecution() // then I should check that entry has not succeeded and cancell/null out entry // before even checking for position?! if (iOrderL1 != null) return; { if (iOrderL1 == null) { CancelOrder(iOrderL1);} { if (Position.MarketPosition == MarketPosition.Flat) { if ( conditions are STILL good = true ) { iOrderL1 = ( LongOrder (sEntryL1); //&& steps asap } } } } To my mind, IF I only check for 'Flat' I might submit an new order for when an entry confirmation is already on its way and get an 'overfill' or some other position issue. ??????????? Jon
Last edited by Trader.Jon; 03-10-2011 at 06:24 PM.
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Connecting to multiple live accounts with MB Trading | raintree | Connecting | 2 | 10-15-2010 01:21 PM |
| NT 7.0.0.19 strategy positions not updating, MB Trading live | Camdo | Version 7 Beta General Questions & Bug Reports | 9 | 08-31-2010 04:32 PM |
| micro trading on NT with MB trading | shan777 | Connecting | 9 | 06-01-2010 02:24 PM |
| live Trading with MB Trading | nigeleyre | Automated Trading | 1 | 04-13-2010 07:05 AM |
| How to connect Live to MB Trading | jtrader1 | Connecting | 3 | 07-07-2009 12:51 PM |