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

Many text drawings causing problems

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

    #16
    high, the memory is under 1.5 megs, its not running out of memory... for sure.

    Comment


      #17
      Hello KhaosTrader,

      We can go in two directions with this.

      You can check to ensure that you are experiencing a bad memory module within the computer itself by running a memory tester.
      Below is a publicly available link to an 3rd party memory tester.
      MemTest86 is the original self booting memory testing software for x86 and ARM computers. Supporting both BIOS and UEFI, with options to boot from USB.


      Or I can create a test script that draws one text object per bar and load 2000 bars and see how a computer with limited memory can handle this on my end and provide you with an export of an example of this script so that you may test this on your end.
      Would you like me to do this?
      (Currently, the snippet of code you have posted has variables that are not declared in the snippet. Also, you have not provided an example script to test.)
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Hi Chelsea ,

        Yes please do the test script, I would like to test 5k draw objects. That is a great idea.. We will both test then we compare results...

        Comment


          #19
          Hello KhaosTrader,

          If you are using the 32-bit version of NinjaTrader 8, and you got a crash after 1.5 GBs, this is may be indicating you have run out of memory (not saying it is for sure, but sound like it may be an indication of). A 32-bit process cannot use more than 2GB and I think this actually rounds down to 1.8.

          If you are using the 64-bit version of NinjaTrader 8, this can use much more memory.

          (Please note, I am not referring to your computer or to the operating system. I am referring to NinjaTrader as 32-bit or 64-bit depending on which icon is used to start NinjaTrader)

          Which version of NinjaTrader are you using?
          (Help -> About...)

          I will not be able to guarantee you can drawn 5,000 drawing objects. This will depend on your system and the amount of memory taken.

          I will create a script on your behalf as one was not included to test, that draws text on every bar and create a short video of testing this and then provide this to you.
          Last edited by NinjaTrader_ChelseaB; 12-06-2016, 04:50 PM.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            Hi,

            I went to about, it says i am using 64 bit... So that is fine there.. Ok, I am looking forward to your test project... Thank you for your help on this, its very much appreciated.

            Comment


              #21
              Originally posted by KhaosTrader View Post
              high, the memory is under 1.5 megs, its not running out of memory... for sure.
              I modified BarTimer to display a DrawText on everybar.

              I have almost 3 years of ES ##-## 15 second chart loaded in a playback Market Replay from the other day.

              Assuming 252 trading days in a year (not sure If this includes sunday), 24 hours in a day, that 6048 hours, 60 minutes in a hour , so 362,880 minutes per year*4 for 15 second bars, is 1,451,520 bars per year, or for 3 years of data (I'm short 2 months), that's 4,354,560 bars and probably a little under estimated.

              my poor 16 gig laptop is now at NT process of 12,255,280K

              Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


              and memory now at 15.3 GB

              Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


              I took those images before reaching max as I was worried that the system would become unresponsive.

              GPU NVIDIA® Quadro® K2100M
              Video Memory 2GB GDDR5

              Comment


                #22
                Originally posted by KhaosTrader View Post

                Below is how I am using draw.text.. maybe i am doing something incorrectly?

                Code:
                						string labelTag = "Replace" + Indicator.CurrentBar; 						
                						Text MyText = Draw.Text(Indicator, labelTag, false, "]Rr[", BarsBack,
                			                    Indicator.Low[BarsBack], 0, Brushes.Black, [B]Quantum_ColorsAndFonts[/B].Font_StopLabelFont_Big, TextAlignment.Center,
                			                    Brushes.Black, Brushes.Cyan, 55);	
                								MyText.IsSeparateZOrder = true;
                								MyText.ZOrder = 9999999;
                						Last_Setup_Long.LabelList_TradeDisqualifyInfo.Add(labelTag);						
                					}
                What is Quantum_ColorsAndFonts? I don't think I have this, so I improvised. (might that be the problem?)


                Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


                I created 200,000+ drawtext in playback Market Replay... some memory usage was seen.

                I paused replay, removed the indicator (that took 20 seconds?).. NT memory went down, I added the indicator back - NT8 shot back up to 956K...

                Scrolling through all these bar is pretty slow while in Pause mode.

                I removed 1 more time, and added your MyText. Zorder commands, 1,000,000K now...

                Comment


                  #23
                  Originally posted by NinjaTrader_ChelseaB View Post
                  Hello KhaosTrader,


                  If you are using the 64-bit version of NinjaTrader 8, this can use much more memory.



                  I will not be able to guarantee you can drawn 5,000 drawing objects. This will depend on your system and the amount of memory taken.

                  I will create a script on your behalf as one was not included to test, that draws text on every bar and create a short video of testing this and then provide this to you.
                  Test this - Run Playback for 1 second ES chart with an indicator that draws an textobject.

                  NT8 appears to become slow after a while (or maybe I've had too many replays in a row tonight testing this and coming up short).

                  Pause Replay.

                  Disconnect Replay.

                  Remove indicator that has drawn a TON of objects. (This should take a "while").. While this is still happening -> connect to Playback Market Replay.. CRASH...

                  Unhandled Exception Trapped
                  Collection was modified; enumeration operation may not execute.
                  System.InvalidOperationExceptoion: Collection was modified; enumeration operation may not execute.
                  ...

                  NT needs to wait until some clean up has happened.

                  *I was able to reproduce this
                  Last edited by sledge; 12-06-2016, 11:46 PM.

                  Comment


                    #24
                    I brought up NT8 32 bit and tried to crash it.

                    I ran replay 15 second chart for 3 months... removed indicator, added back, no crash.

                    realized I was on 15 second and removed indicator, changed to 1 second chart, added indicator... no crash...

                    but chart is only 1/2 of the chart now..

                    Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


                    yeah this is pretty messed up now... hitting play doesn't help anything... it's trashed.

                    Comment


                      #25
                      Hi Sledge,

                      I am using Tick charts.. The crashes happen for me when I have a chart loaded with a lot of data, and then close ninja and re-open ninja where it automatically loads a heavy chart where draw objects are made...

                      Also I notice that when I launch Ninja, it shows the chart, then there is some sort of "refresh" that occurs when the dataservice actually connects - maybe that is the problem, i dont know..

                      Regarding colors and fonts, I have a class where I instantiate once, that creates fonts and color brushes (with freeze) upon instantiation -- that way I dont have to make many brushes.

                      Regarding my application - it has about 80 classes. Of these there is a TradeSetupClass which is instantiated twice, once for longs, and once for shorts. The class has a method where it will draw annotations for the setup such as targets, stops, risk, etc.. It also has a method where it can remove the drawing objects that illustrate the setup. I also have a TradeManager class which is instantiated once, but it it references the TradeSetupClasses also. The TradeManager class can annotate the life cycle of the trade -- it will mark which targets were hit and where, when and where the trade stopped out, as well as if the trade setup has been replaced or if the trade setup was cancelled.

                      Therefore I have 2 class types that can draw and remove drawobjects. One of those classes is instantiated twice.. Therefore I have 3 different objects that can draw and remove drawings on the chart.

                      Maybe there is a problem with that structure.

                      Comment


                        #26
                        Originally posted by KhaosTrader View Post
                        ...

                        Therefore I have 2 class types that can draw and remove drawobjects. One of those classes is instantiated twice.. Therefore I have 3 different objects that can draw and remove drawings on the chart.

                        Maybe there is a problem with that structure.
                        I would sincerely be inclined to doubt that. My NT7 strategy setups have more than that: typically one each long and short, each with 3 TradeManager objects each of which loads a TradePrices object. The TradeManager objects place and replace multiple lines and text objects which mark trades on the chart. And there are multiple strategies running, many of the current strategies using a similar structure.

                        Then again, I have been pretty busy, so have scaled back NT8 work considerably, so I do not know how well my setup will work in NT8.

                        Comment


                          #27
                          Oh, I see. My code is only under Ninja8... I wonder why text objects are so darn heavy in ninjatrader...

                          Anyway,I am waiting for support to give me their script and I will run it and see what happens on my system....

                          I appreciate your help and research that you did on this... Thank you. Hopefully the problem will be figured out soon.

                          Comment


                            #28
                            Hello KhaosTrader,

                            I've done some testing with drawing text using Draw.Text(), but I am not able to reproduce the crashing.

                            I've created a video of this test.
                            Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


                            Attached is an export of the script I am testing.

                            Please close all workspaces and then test using a new chart using the steps you see in this video.

                            Let me know if you are able to produce using this script with these steps.
                            Attached Files
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #29
                              Hi, ok thank you , I will test it tonight -- after trading ends -- and give you results first thing in the morning...

                              Thank you again for your help on this...

                              Comment


                                #30
                                Hi, I just ran it (I was so curious couldnt wait .. haha).. I did 50k bars, no problem at all.. It worked like a charm.

                                So now I have not a clue why i am having problems with my code -- when I use drawobjects...

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by frankthearm, Today, 09:08 AM
                                10 responses
                                35 views
                                0 likes
                                Last Post frankthearm  
                                Started by GwFutures1988, Today, 02:48 PM
                                0 responses
                                2 views
                                0 likes
                                Last Post GwFutures1988  
                                Started by mmenigma, Today, 02:22 PM
                                1 response
                                3 views
                                0 likes
                                Last Post NinjaTrader_Jesse  
                                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
                                28 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Working...
                                X