Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trading Live with MB Trading disconnects?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Trading Live with MB Trading disconnects?

    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:
    • Wait until flat before executing live vs. Immediately submit live working historical orders
    • “Cancel entry orders when a strategy is disabled” and “Cancel exit orders when a strategy is disabled”.
    • Sync account position True/False
    If I want to have this strategy keep running and tracking positions I think I need to do the following:
    • Use “Immediately submit live working historical orders” so if I have to reboot my computer for some reason it will pick up where it left off.
    • Uncheck “Cancel entry orders when a strategy is disabled” and “Cancel exit orders when a strategy is disabled” so I can shutdown and start up NinjaTrader for computer updates.
    • Sync account postion = true so if my strategy tried to rebalance when I had the system down it will rebalance when the system comes back up.
    Am I setting this up right?
    Thanks,
    Erik

    #2
    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.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand,

      That being the case, is there any sync options that should be initiated as soon as a 'position event' is received from MBT ??

      Comment


        #4
        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.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          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

          Comment


            #6
            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.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              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

              Comment


                #8
                More on kind of disconnects

                Originally posted by NinjaTrader_Bertrand View Post
                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.
                Taking an explicit scenario: MB forex trading intraday with no positions held at 5pm EST close ... should there be an account sync &/or trade in progress test of some type BEFORE each market position test for trade entry to verify if any disconnects have not 'neglected to report' altered trade status. I am speaking on use of managed orders.

                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 covers

                Thanks for clarification,
                Jon
                Last edited by Trader.Jon; 03-04-2011, 05:14 PM.

                Comment


                  #9
                  Jon, Bertrand will be back in on Monday and I will have him respond then.
                  AustinNinjaTrader Customer Service

                  Comment


                    #10
                    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?
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_Bertrand View Post
                      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,

                      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

                      Comment


                        #12
                        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.
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          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).

                          Comment


                            #14
                            Hi Erik, would you mind sending the logs and traces for this one via Help > Mail to Support?

                            Thanks,
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by NinjaTrader_Bertrand View Post
                              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,

                              // 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, 07:24 PM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by aa731, Today, 02:54 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post aa731
                              by aa731
                               
                              Started by thanajo, 05-04-2021, 02:11 AM
                              3 responses
                              470 views
                              0 likes
                              Last Post tradingnasdaqprueba  
                              Started by Christopher_R, Today, 12:29 AM
                              0 responses
                              10 views
                              0 likes
                              Last Post Christopher_R  
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              166 responses
                              2,237 views
                              0 likes
                              Last Post sidlercom80  
                              Started by thread, Yesterday, 11:58 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post thread
                              by thread
                               
                              Working...
                              X