Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

"System.OutOfMemoryException" was thrown

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

    "System.OutOfMemoryException" was thrown

    Hi,

    (1)
    {
    startDateTime1ea = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 9, 30, 0);
    endDateTime1ea = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 9, 44, 59);

    int startBarsAgo1ea = GetBar( startDateTime1ea);
    int endBarsAgo1ea = GetBar( endDateTime1ea);

    do something here


    startDateTime1eb = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 9, 45, 0);
    endDateTime1eb = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 9, 59, 59);

    int startBarsAgo1eb = GetBar( startDateTime1eb);
    int endBarsAgo1eb = GetBar( endDateTime1eb);

    do something here

    }


    (2) I've done the above over an hour's market session and applied on FDAX 1 Range Chart. I even set begin and start time within an hour in the chart properties. If I code for the entire market session, I think it will be worst. During the application, I encountered the problems:
    (a) First, when I load up the indicator, after a few minutes, NT was foced to close down with the message "System.OutOfMemoryException" which I read from the trace file.
    (b) Second, if NT is not forced to close down, it will take unbelivable 10 minutes or even more to show the indicator on screen.(Please refer to the attachment "ntplot4' The case stayed there for the duration I mentioned above) The funny part is that the appearing of indicator takes two steps to plot.It plots my DrawLine and DrawRectangle then it stops for a minute or two (Please refer to the attachment "ntplot2") before continuing plotting my DrawRegion. The case happened when the market is very active .(That is a lot more bars than normal.)
    (3) Occasionally,when the market is active,moving of cursor seems to cause delay as well.
    (4) My indicators are only valid for that specified time range .Any new time range start,a new set of calculation is started and the previous set of calculation is not in use anymore.Is NT does all the calculations from the first bar to current bar whenever there is a new incoming tick? If so ,how can I write a logic to terminate the previous calculations which I'm not needed? Could it help in terms of CPU and Ram? I've used RemoveDrawobjects when new time range started.
    (5) I'm using XP Professional, Intel Pentium D CPU 2.8/2.79 GHz and 1.5 GB Ram.
    (6) Attachment "ntplot5' is an example of my indicator layout.
    (7) I hope you understand my explanation in such a poor English
    Attached Files

    #2
    continue from #1
    Attached Files

    Comment


      #3
      obayashi, welcome to our forums - how much history are you loading up for your Range chart of the FDAX?

      Is this on the latest NT 6.5.1000.16 release version?

      If you like to test, the performance in general and especially on Range bars would be strongly improved in our currently in beta testing NT7 version -





      If you want to just monitor current developments in realtime it would be best to just modify one drawing object instead of creating unique ones to recreate the historical signals -

      BertrandNinjaTrader Customer Service

      Comment


        #4
        Hi Bertrand,
        (1) Currently I'm only loading one hour of historical data.(eg from 0900 to 1000).
        (2) At present I'm using NT 6.5.1000.15
        (3) If I upgrade to NT 6.5.1000.16 or download NT7, will my current indicator lost?

        Comment


          #5
          No, you will not lose your indicators as you upgrade to a different version.
          Josh P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by mmenigma, Today, 02:22 PM
          0 responses
          1 view
          0 likes
          Last Post mmenigma  
          Started by frankthearm, Today, 09:08 AM
          9 responses
          32 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by NRITV, Today, 01:15 PM
          2 responses
          9 views
          0 likes
          Last Post NRITV
          by NRITV
           
          Started by maybeimnotrader, Yesterday, 05:46 PM
          5 responses
          26 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by quantismo, Yesterday, 05:13 PM
          2 responses
          20 views
          0 likes
          Last Post quantismo  
          Working...
          X