Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT7 produce Heap Corruption

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

    NT7 produce Heap Corruption

    Hi,

    I'm dev a system for automating trading, and spend many times lasts days for search why i have corrupted heap when doing intensive market replay.

    So after eliminate all others possibles causes of this like native libraries i'm using, i'm stay only whith NT7, because the only way to make heap corruption in c# is to have a thread safe code problem, and i'm cutting too all users interfaces using multithreading in my application.

    So for be sure, i'm write a simple strategy code who doing similare intensive trades than my real strategy, without using nothing else than Ninja trader himself and the embeded compiler.

    The result is NT7 have Heap corruption problems, from native code or multithreading thread safe problem on NT7 c# code.
    I'm re-install totaly Ninjatrader 7 for repeat the test before post here.

    For reproduce the problem, i'm attached a simple strategy code and a realLineBreak chart type.
    Run the replay on RealLineBreak chart Period Type : Tick, periode value 1 break 28.
    After some day of data replaying, you must have a heap corruption.

    It's seem more rapide to have with many flood on output windows.

    I'm really need a solution about this.

    Thanks
    Attached Files

    #2
    Hello Twanaar,

    Thank you for your post.

    What dates and what instrument(s) are you running Market Replay with the strategy on?

    Comment


      #3
      i'm running ES on 03-16 from 1st january, but it's occurs with any date and surely any instrument.

      The replay need to be made at 500x time, i'm making some little change on the code consiste mainly to reduce the frequency (about 4 times less than the sample) of the stop lost order update and the replay seem more stable (need more time to be sure).

      If it's confirmed i'm think the problem come from a thread safe problem about high frequency orders updates.
      Last edited by Twanaar; 10-26-2016, 03:19 PM.

      Comment


        #4
        Hi,

        Im modified my sample code for take in count about the multi-threading between OnBarUpdate and OnOrderUpdate/OnExecution/OnPositionUpdate.

        The stability increase a lot, from 3 days of replay max to 2 months, but i'm still crashing, so it's seem it's not entierely my fault and still have a problem somewhere.

        See the modified sample in attachment.
        Attached Files

        Comment


          #5
          Hello Twanaar,

          Thank you for the update.

          I will review and follow up with you here.

          Comment


            #6
            Hello Twanaar,

            How many days do you usually have to play through for this to occur?

            Comment


              #7
              Generaly, i have the heap corruption after more or less 4 days of replay without the lock, 2 months with the lock.

              And another notice: i'm just dicover when i'm replay at 50x times speed or less, i'm don't have the heap corruption, it's happen only for 100 to 500x times speed.

              I'm generaly don't have the heap corruption on my virtual machines in replay too, but they are slower than my main computer (i'm using 13 VM with 2gb of ram for doing replay stuff for tunning my stratgies on two servers).

              My main computer doing replay with a i7-960, 12GB ram, a SSD disque for the data, the speed of replay seem affect the probabilities to have or not the problem.

              So it's seem really a multi-threading concurency race condition problem.
              Last edited by Twanaar; 10-29-2016, 11:44 AM.

              Comment


                #8
                Hello Twanaar,

                Thank you for your response.

                May we test with the Market Replay data you are using?

                If so, please send a note to platformsupport[at]ninjatrader[dot]com with this thread as reference and attach the replay data.

                The data will be located under Documents\NinjaTrader 7\db\data. Please place the dates you replay into a .zip folder be selecting each date you replay and right clicking and selecting Send To > Compressed (.zip) folder.

                Comment


                  #9
                  Hello Patrick,

                  Sorry for the delay,

                  So i'm send a mail with my data as asked, i'm hope that help to reproduce the problem.

                  Regards.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Perr0Grande, Today, 08:16 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post Perr0Grande  
                  Started by elderan, Today, 08:03 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post elderan
                  by elderan
                   
                  Started by algospoke, Today, 06:40 PM
                  0 responses
                  10 views
                  0 likes
                  Last Post algospoke  
                  Started by maybeimnotrader, Today, 05:46 PM
                  0 responses
                  12 views
                  0 likes
                  Last Post maybeimnotrader  
                  Started by quantismo, Today, 05:13 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post quantismo  
                  Working...
                  X