Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT core software failure

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

    NT core software failure

    I am running my strategy in the debugger because it fails sometimes. I get the following exception, although the "array bounds" problem is not part of my code. Here is the code where this happens: (entry_dir = 1, entry_target = 836)

    if( entry_dir )
    ExitLongLimit( entry_target );
    else
    ExitShortLimit( entry_target );



    At the line "ExitLongLimit( entry_target );" I get a crash:
    System.IndexOutOfRangeException was unhandled by user code
    Message=Index was outside the bounds of the array.
    Source=NinjaTrader.Core
    StackTrace:
    at NinjaTrader.Strategy.StrategyBase.PlaceOrder(Int32 selectedBarsInProgress, Boolean liveUntilCancelled, OrderAction action, OrderType orderType, Int32 quantity, Double limitPrice, Double stopPrice, String signalName, String fromEntrySignal, String oco, Boolean simStop)
    at NinjaTrader.Strategy.StrategyBase.ExitLongLimit(Do uble limitPrice)
    at NinjaTrader.Strategy.TradeRetrace.OnBarUpdate() in c:\Users\daniel\Documents\NinjaTrader 7\bin\Custom\Strategy\TradeRetrace.cs:line 391
    at NinjaTrader.Strategy.StrategyBase.Process(Object sender, BarUpdateEventArgs e)
    InnerException:

    What happens if I no longer have a long position, will NT handle this call properly or fail? I know this is not the problem because I already checked for having a position, but it is still important to know. The Position.MarketPosition is Long with a quantity of 2.
    Last edited by tradetree; 02-18-2011, 09:21 PM.

    #2
    entry_dir looks like an integer, not a bool. the if ... construct requires a boolean expresssion in the brackets. In C# the only values that satisfy a boolean condition are true and false, which are official keywords. false is NOT the same as 0 in C#.

    Comment


      #3
      My post was misleading. entry_dir is a bool and is "true". I used "1" as a shortcut for "true" in my post. In my code it is bool and is "true." The strategy would not have compiled otherwise. It compiles and runs just fine for thousands of iterations. Intermittently it fails, but this code has already been proven prior to the failure.

      Regardless of entry_dir, ExitLongLimit should not be failing with an unhandled exception. PlaceOrder is called by ExitLongLimit and is the point of failure.

      What if the price passed into ExitLongLimit is a multi-precision decimal, ie. 787.0123454321 and not 787.05? Is it possible ExitLongLimit has a bug and can't handle that?

      Can MarketReplay be used to recreate failures conditions?
      Last edited by tradetree; 02-18-2011, 11:40 PM.

      Comment


        #4
        tradetree, on which NT version # are you testing here? Did you in MarketReplay on the same days / same data - would the issue be reproducible for you?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I am using the latest (or 2nd to latest) NT 7.1.0002. I never knew what market replay did until today. I think you replied to my other thread on problems I'm having with running it under market replay, but I'm working on that.

          Comment


            #6
            Ok, thanks for the reply - yes I recall your other thread on that topic now - if you would like me to give it a run here on my end, please contact me at support at ninjatrader dot com.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Thanks for the offer Bertrand. The problem I have is with proprietary algorithms. I don't want to release my code even if the risk is low in sending it to NT. Is there anyway CliSecure can help here? Can their product obscure my code so that you could reproduce it without getting to the heart of my algorithm?

              I put a customer service question in last week on this topic and I'm in discussion with them.

              Comment


                #8
                tradetree, while confidentiality is assured if you send us code for testing, I can definitely understand your position. CLISecure would unfortunately not help me much, as for showcasing the stripped issue to the developers I would need open code anyways. If you like though I can run your CLISecure version on my end and simply see if it's reproducible for me, then you're one step further in the debug process and know it's not a local only issue and could take it from there.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Thanks again for the clarification. I have a plan for now. I have a strategy that does not crash using Market Replay. I will start with this strategy and add my failing strategy code to this one. The problem I'm having is that I can't even startup with the failing strategy, before it even executes any of my code. So my hope is that I can isolate the problem this way.

                  Comment


                    #10
                    Here is a lesson for all of us. The reason my strategy would not "replay" was because in the strategy settings it had the real-time data for the "Account". The Account field has to be changed to "Market Replay". So when I added another strategy it would work, as it defaulted to "Market Replay" for the Account field. This was not documented to my knowledge.

                    Comment


                      #11
                      Thanks for sharing, did you 'take over' the strategy from a live trading chart where it was set initially to a live account of yours as well?
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        Hello tradetree,

                        I am running since some weeks basically into the same NT core software failure. Concerning that see my thread: http://www.ninjatrader.com/support/f...ad.php?t=37741 ( #25 )

                        I also decided last week to do debugging within Visual Studio, but could not fix it. However what I have found out is the following. By the way, I am using the latest version of NT 7 and IB TWS 911.3 and I am trading overnight strategies on daily bars.

                        When running strategies are disabled NT loses references to existing IB stop orders, later account synchronization does not work correctly.This leads to a chain of other problems (index out of range error, etc.). NT strategies are disabled in the following situations:
                        § TWS closes down
                        § Crash of NT
                        § Manually disabling the strategies due to new code update

                        I found that out because in some of my traded instruments it did not happen and the difference was, that the existing stop orders there were still correctly referenced by NT.

                        Bottom line for me: This is an synchronisation error between NT and IB and happens after NT looses connection to IB. The synchronisation afterwards does not work correctly, IB stop order references get lost and this leads in my case to this kind of error. I assume the error is on NT side, since IB has in general a well working API.

                        Best, Peter

                        Comment


                          #13
                          My testing has shown that with the current version of NT 7 there is no chance to get this solved. The only thing I can think of at the moment is that NT always keeps connected to IB and never looses connection.

                          Hopefully they fix this on Ninja side sooner or later!!

                          Comment


                            #14
                            Peter, would you mind contacting me at support at ninjatrader dot com with the steps you take to see / reproduce this issue so I could investigate?

                            Thanks in advance,
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              Bertrand, I will contact you probably not before tomorrow due to this issue, but I will come back to you.

                              Peter

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by frankthearm, Today, 09:08 AM
                              3 responses
                              7 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by yertle, Today, 08:38 AM
                              5 responses
                              15 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by adeelshahzad, Today, 03:54 AM
                              3 responses
                              16 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by bill2023, Yesterday, 08:51 AM
                              6 responses
                              27 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by NinjaTrader_ChelseaB, 01-08-2017, 06:59 PM
                              80 responses
                              19,667 views
                              5 likes
                              Last Post NinjaTrader_ChelseaB  
                              Working...
                              X