Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT failure killing me

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

    NT failure killing me

    I had mentioned in another thread that I had a strategy seemingly randomly fail to execute under peculiar circumstances. Today it happened again, and I am 100% certain it is a NT bug that cost me $2950 today. This must stop NOW. It has cost me over $4500 this year alone.

    I have a multi-instrument strategy that runs on ES, and enters off of a signal on SPY. I run an identical copy (with a different name) on SPY/SPY (SIM) as well to confirm everything is functioning. I have trace turned on, and write out triggers to the output window.

    Today the strategy on SPY/SPY executed as normal, but the ES/SPY did not. There were no data interruptions, and all orders should be market orders. The SPY wrote to the output window, log, and trace just as it should, but there is NOTHING from the ES/SPY strategy.

    I took snapshots of every screen/parameter/window, and NT swears the strategy was running live on my account with the correct parameters. It simply never did anything.

    Now to the likely culprit: NT asked IB for an account update the same minute it was supposed to be entering the trade. At least one of the other times this failed it was under the same condition. The most logical conclusion is that a bug in NT is disabling live trading (at least partially) when it is getting ready to send an account update request.

    Whatever the failure of NT is, it has already cost me several times the lifetime subscription I purchased.

    How do I fix this?

    I asked before, and I'll ask again directly: how do I turn off account updates? I do not need them or want them, and they are causing serious problems.

    #2
    Have you thought about using a different broker to trade the ES? Is this a problem with the new TWS 8.93 or TWS backend server?

    Comment


      #3
      zstheorist,

      NT has its problems, no doubt. But, IB doesn't help. I ran with IB for a long while, before I finally switched to Zen Fire+AMP. The change has been HUGE in terms of NT performance, and it eliminated a LOT of crashes and problems.

      However... no stocks or ETF's with Amp... only futures.

      Mike

      Comment


        #4
        Unfortunately there is no way to turn off account updates. What exact error (error message? screen shot?) have you got?

        Comment


          #5
          problem

          That is the problem. There is no error message or any trace at all in the output window, log, or trace, despite the issue.

          What I have are screenshots of the 1 min charts I was running on the ES/SPY and SPY/SPY where 1 executed and the other did not.
          - Data was stored in real time.
          - I took a screen shot of the NT tabs, the strategy window from the chart (where it was turned on), and the Data Box from SPY for every minute around the event, which shows my indicators unambiguously did what I expected.

          I wish it were as simple as an IB problem, but this strategy never got far enough to try to send something to IB. I am currently using NT 6.5.1000.8, and the version of TWS I got from NT to go with it - 887.2.

          Comment


            #6
            If you look at your orders tab, was an order place that did not get filled? Or, was no order placed at all?

            Mike

            Comment


              #7
              zstheorist,

              You need to compare apples to apples here. Why are you running your ghost strategy as SPY/SPY and not ES/SPY? Without actually seeing your code I would not know how this influences your tests, but under most cases it does.

              If your strategy logic did indeed evaluate to true it will submit the order. As far as if your order goes through or not, you will get TraceOrders output letting you know what exactly happened with your order. I suggest you add Print() functions before and after your EnterLong() or any other order type to see if your code even reached such segments. This is the only way to know if your strategy should trade or not. Please confirm your code did in fact reach an order command.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                crtlbrk: No order was placed at all. When the condition is satisfied I write to the output window, my SPY/SPY strategy did, my ES/SPY did not. Nothing appears in the trace other than the strategy starting up and shutting down.


                Today I missed another $1375 as it failed to execute. This is maddening! I have been running this strategy for a year with these parameters in this manner, and now 2 days in a row it fails to execute!


                NinjaTrader_Josh: I am making a perfect apples to apples comparison. The reason I run on SPY/SPY is so that I have a chart that plots the exact indicators I am using. In both cases, all of the work is done on the second contract. I
                Add("SPY",PeriodType.Minute,1);
                and
                if (BarsInProgress == 0) {
                ...
                double lA0 = SMA(Closes[1],LTime)[0];
                ...
                if (lA0 > xxxdble)
                EnterLong(DefaultQuantity,"Long");
                endif
                }

                Identical code is run on SPY/SPY and ES/SPY. Both execute based on the 2nd contract (SPY) only, and open a market order on the first contract. The SPY/SPY confirms absolutely that the 2nd SPY triggers. Again, this has worked for a year, it just no longer does.

                Nothing has changed in my code here, and yet it is suddenly failing to execute on the most profitable days of the year.
                This only executes a few times a week at most, so a few missed days costs me a fortune. Statistically, it really costs me, because those winning days are needed to counteract the losing days.

                I am ready to do whatever it takes to fix this - recompile NT from scratch if I need to. If I had any reason to believe updating NT to 6.5.9 would help I would, but that changes TWS, and introduces other possible problems. Nothing in the fixes implies that it would help my issue.

                Should I rewrite and recompile every strategy?

                Comment


                  #9
                  Not sure what you are doing is apples to apples.

                  Consider the code snippet you provided:
                  if (BarsInProgress == 0) {
                  ...
                  double lA0 = SMA(Closes[1],LTime)[0];
                  ...
                  if (lA0 > xxxdble)
                  EnterLong(DefaultQuantity,"Long");
                  endif
                  }

                  BarsInProgress == 0 means you are working in the first bar series. Your orders are being placed to the ES in one run and SPY in the other run.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    Why not apples to apples

                    OK, explain how this cannot be the same. While I am placing an order on the first instrument, all logic applies ONLY to the second instrument. Why is it relevant which actual instrument I am placing the order on? I could be placing a market order to buy XYZ, and it should fire off just the same.

                    I can only conceive of one instance in which it matters, and it has to do with data synhronization internal to NinjaTrader. If the situation comes up (tomorrow?) that this should execute again, I'll see if I can "force" a data update. If it does execute, then there are larger structural problems here for any multi-instrument strategy.

                    Comment


                      #11
                      zstheorist,

                      The code you have posted does not apply any logic to the second instrument. Everything you have is against the first instrument. Sure you may be using Closes[1], but that doesn't make it the same. The BarsInProgress == 0 events are completely different across your two instruments. You are running calculations based off of instrument A which references instrument B at completely different times. You are then comparing how your strategy runs on the ES versus how it runs on the SPY hoping it would be the same. This is absolutely different in every regard possible.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        An unfortunate discovery

                        OK, it cost me another $3400 to confirm this today, but I have determined how to get around this.

                        First in answer to NinjaTrader_Josh: You are correct in one thing: The bars are not exactly the same. If NT was operating correctly it would not matter, because AT WORST I would enter 1 bar later. Unfortunately the NT logic for multi-instrument strategies is fatally flawed.

                        I may try to explain the flaw in detail later, but here is how I got my strategy to run today: First load SPY chart and run strategy SPY/SPY, THEN load ES chart and run strategy ES/SPY. As I guessed, the different charts interact.
                        - What is happening is, by running SPY/SPY FIRST, I "force" NT to update the data on SPY. Then when it sequentially goes to ES/SPY the SPY for that bar is already loaded, and ES sees it.
                        - My best determination for the failure is that if ES was opened BEFORE SPY the data for SPY is out-of-sync. Instead of taking the available data, NT just ignores the if-then statement completely. This is incorrect behaviour, but there is pretty overwhelming evidence of this at this point.
                        Not having the source code, I cannot determine if it evaluates to a bad case, and it trapped, or fails for some other reason. There is no excuse not to trigger at SOME time, even if at the wrong time.

                        Both of these are major flaws, but I did work around my problem for now.


                        PS Your forums are beyond annoying. It logs me out EVERY time I hit submit, and erases my response the first time. The second time I log in and retype (or repaste it) it sticks.

                        Comment


                          #13
                          zstheorist,

                          There is no flaw in multi-series strategies. Strategies do not start running till all of their series have at least 20 bars (default setting). As mentioned several times already running a strategy as SPY/SPY is absolutely not the same as running a strategy as ES/SPY when you use the primary instrument as part of your logic. The code example you have posted indicates an integral part of your logic is triggering events off of the primary instrument. The events coming from SPY primary is completely different than those coming from an ES primary and as such all of your logic is not comparable.

                          When you load ES/SPY what happens is it will load ES data then load SPY data then start calculating once 20+ bars are reached on both series. The only thing loading up an SPY/SPY first does is bring the SPY bars series into memory already so after you finish loading up the ES you already have the SPY in loaded too. None of this changes when and how a strategy starts. Given the exact same chart an ES/SPY strategy will run exactly the same with or without loading an SPY/SPY first.

                          I suggest you first get a clear understanding of how multi-series works. Create yourself a multi-series strategy where all it does is print bar timestamps from each BarsInProgress context. Run that strategy and then you will understand the sequence of events.

                          Code:
                          if (BarsInProgress == 0)
                               Print(Time[0].ToString());
                          else if (BarsInProgress == 1)
                               Print(Time[0].ToString());
                          Also, especially since you are testing, I highly recommend you to not trade on your live account. NinjaTrader comes with full simulation functionality where you can test strategies against a simulated paper trading account. There is absolutely no reason you would need to use real money for early phase testing.

                          As far as your forum issues go, please be sure you are on an up-to-date web browser. This forum uses vBulletin software which is industry standard.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            Hi
                            zstheorist

                            it looks like the problem is you self. From how you write it seems that you are quite stressed and angry.
                            For a trader such emotions are a sure recipe to loose money and to follow down the loss spiral.
                            Go for a long w/e and then trade smaller lots next week!

                            As I see from your code:
                            EnterLong(DefaultQuantity,"Long");

                            you rely on the NT order wrapper code, and EnteLong will in this case be linked to BarsInProgress. Be sure that all orders are linked to the same BarsInProgress.

                            From my small experience with NT I would say that their code is reliable and behaves as expected.
                            I was working on 2 strategies last week and allthough tested on the simulated account when I started running them live new errors in my own logic appeared and I had to fix my code.

                            good luck
                            ANDREAS

                            P.S. Personally I prefer the
                            EnterLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice,string signalName)
                            function.

                            Comment


                              #15
                              if only

                              I am only termporarily stressed when large amounts of my money vanish despite my running a code that worked fine for months. I fully understand why it worked before and suddenly ceased working, because I have gotten it working again.

                              Other irrelevant issues have been brought up to try to explain how "I" must have done something wrong, while never taking responsibility for a logical flaw in NT. I have absolute proof of what is happening when my strategy executes successfully, because I have been logging everything for a year.

                              I am sorry Josh, but you are wrong. It may be that it is SUPPOSED to be irrelevant what order things load, but it is not. Here is what actually happens (note the one thing I am NOT willing to lose money to debug for you is to determine what absolute order of the 4 steps is necessary).

                              1. Load SPY chart with PLENTY of history (weeks).
                              2. Load ES over the same LONG time period (far longer than the strategy - also I am using SMA, so there is no data starting value issue).
                              3. Load strategy on SPY
                              4. Load strategy on ES

                              Take today. At the close of the 8:54 bar on SPY my strategy should trigger on ES and SPY. Despite SPY loading and running first, the first output in my log is that a long on ES was triggered at 8:53 (ES time), with a readout of the values of my indicators appended. Then a log entry appears at 8:54 (SPY time) that a long on SPY is triggered. All other written out numbers are identical - as they should be.

                              Prior to this not working, I was running a different strategy on a chart that also loaded SPY first, and then the current one. Shortly after I stopped running that strategy, so that I was loading the ES chart followed by the SPY chart, is when the ES strategy stopped evaluating. As soon as I swap the order in which they are loaded - bam - it runs again.

                              The two paragraphs above serve as absolute proof of my assertion that SPY data must be in memory before this will run, and that there is a data-sync issue between the strategies. I am fine with the data sync issue. I do not care what ES bar it is, only that it executes.

                              The problem is that loading SPY second I still get executions on SPY, but NOT ever on ES. The time stamps I've written out tell the order of evaluation, but if it were always consistent, then ES should still execute, just 1 bar late.

                              You will never see these issues in a backtest, because all data are already stored to disk and available. In real time, NT gets data sequentially, and treats it asymmetrically.

                              Again, I fully understand the data-sync issue. I disagree with the programming choice that makes it possible, but as I've documented it, I can live with it.

                              What is troubling is that if I run ES then SPY, I do not get an execution at 8:54 (SPY time) and then 8:54 (ES time). Somehow, the moment is lost. This is not symmetric. The logic just never fires - hence no log entry. There are subtle hidden data dependencies going on under the hood of NT that make programming a multi-instrument strategy risky far beyond whether the logic of the strategy is sound. I am glad that I can at least get things moving again.

                              All I can say is, keep a keen eye on ALL of your strategies if you touch ANYTHING in any part of your code, or the order you load things.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by strategist007, Today, 07:51 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post strategist007  
                              Started by StockTrader88, 03-06-2021, 08:58 AM
                              44 responses
                              3,967 views
                              3 likes
                              Last Post jhudas88  
                              Started by rbeckmann05, Today, 06:48 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post rbeckmann05  
                              Started by rhyminkevin, Today, 04:58 PM
                              4 responses
                              55 views
                              0 likes
                              Last Post dp8282
                              by dp8282
                               
                              Started by iceman2018, Today, 05:07 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post iceman2018  
                              Working...
                              X