Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Database bug

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

    Database bug

    Hi,

    I have a situation where I have multiple strategies linked together and I often get orders stuck in a pending status (in simulation). The only way I have found to get rid of the orders is to reset the simulation account.

    Because of the large number of strategies that work together to comprise the overall trading strategy, I normally edit the strategies to change the account from Sim 101 to Sim 102 then reset Sim 101 (to get rid of the stuck order) and then edit the strategies again, changing the account back to Sim 101.

    I understand I could simply reset the account and put the strategies back on but that is much more trouble for reasons not germane to the issue.

    Often I get the NinjaTrader database error as shown in the attached screenshot. This is not a one time thing, it is frequent but not on every strategy and not every time. I thought you might want to look in to the issue.

    Also, is there any way around strategies being deleted when moving between Replay mode and simulation? Again, I have a large number of coordinated strategies and it is problematic to have to reenter them each time I reset the time (which I have no option on when first starting replay mode).

    Thanks in advance.

    Scott
    Attached Files

    #2
    Scott,

    Thanks for the note.

    This has been a small issue I have seen happen only on the simulator and never live usually due to a bad shutdown of NinjaTrader for example or a disconnect in the middle of order processing on the simulator.

    I do not see it very often and to this point I have never been able to duplicate it in the office.

    Therefor resetting the simulator when this occurs has been the steps we take on this.

    However, it sounds like this is happening more frequent for you?

    Are you able to reproduce the error on your side with some steps I could follow to resolve. As I would need steps to reproduce this so we can analyze what exactly is going on to get this stuck order in simulator.

    -Brett

    Comment


      #3
      Brett,

      I think it is related to the stuck order issue. I am probably pushing NinjaTrader further than it was meant to go. This is a quasi market making application so I am sending a lot of order modifications. I think what is happening I have an order in a pending change state and then sending additional modification requests in. At some point I think it just gets to be too much.

      Once that happens, I have to do the reset. I have several interrelated strategies communicating with each other through some custom code so I am trying to avoid removing them all and then adding them back (hence the edit to Sim 102 and back). The custom code is not the issue, I have verified that on numerous occasions.

      I can tell you that if I shut NinjaTrader down and restart, it seems to know where things are and will proceed correctly from there. I also, have only experienced this in simulation never with live trading (this trades live regularly).

      Not to worry, I just happened to think to take a screenshot and thought I would share it. This is more of annoyance than a cause for concern.

      Best Regards,
      Scott

      Comment


        #4
        Agreed, we are on the same page with this item.

        Thanks for posting, for sure if you ever can get something nailed down as to what causes it while your testing/trading happen to run across some details that would assist on this one I would appreciate them.

        Thanks and wish you a great rest of the day.

        -Brett

        Comment


          #5
          Brett,

          One other thing I forgot to mention; for the sake of consistency, if I am in Global Simulation Mode, I would like NinjaTrader either to not allow execution in simulation accounts other than Sim 101 or allow me to switch the DOM display to the other sim account.

          When going through the process I mentioned in my earlier post, I have to either reset to Sim 102, clear Sim 101 and reset everything back to Sim 101 or come out of Global Simulation Mode (which when testing is an exceedingly bad idea) so I can not only execute in Sim 102 which I can do) but also see my executions on the DOM (which I cannot do).

          As a post script of sorts; I just noticed that it isn't when I edit to change the account to Sim 102 that the error occurs, it is after I change it back to Sim 101 and then attempt to enable the strategy. I used to be a SQL Server DBA (in another lifetime it seems) and it appears as though it is a transaction issue or maybe a cursor.

          From the message you can see it is complaining about inserting a foreign key where there is no primary key. I think it is because of something like an uncommitted transaction where the database is not aware that the original strategy (Sim 101) has been changed to Sim 102.

          Additionally, although it does not happen on every strategy, once it occurs, it will occur on every strategy that I have not yet edited from Sim 101 to Sim 102 and back.

          As I mentioned earlier, saving the workspace (with all the strategies now back in Sim 101), closing NinjaTrader and restarting does fix things. I hope that narrows things a bit.

          Best Regards,
          Scott
          Last edited by ScottB; 08-02-2012, 01:07 PM.

          Comment


            #6
            Scott,

            Thanks for that information.

            I will have this added to developments features to review for next major release list.

            As far as the error, can you reproduce it? I would be interested in reproducing that and get it into development if you had some steps I could follow to reproduce the issue.

            -Brett

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by jpapa, Today, 07:22 AM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by kevinenergy, 02-17-2023, 12:42 PM
            116 responses
            2,757 views
            1 like
            Last Post kevinenergy  
            Started by franatas, 12-04-2023, 03:43 AM
            7 responses
            106 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Jltarrau, Today, 05:57 AM
            3 responses
            8 views
            0 likes
            Last Post Jltarrau  
            Started by f.saeidi, Today, 05:56 AM
            2 responses
            8 views
            0 likes
            Last Post NinjaTrader_Erick  
            Working...
            X