Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart Loading Delayed By Indicator

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

    Chart Loading Delayed By Indicator

    Hi,

    I am using a new indicator and it really delays my chart from loading... I know the programmer is good so probably just requires a lot of work to fill the data... I use 2 and 5 minute charts and also look at 15 and 30 minute charts loaded for past 15 days... No matter the minute time frame the charts take the same time...

    If I load a new instrument with no template/indicators it takes 2 seconds to load, with my main template and a few indicators it takes 5 seconds to load but then when I add this one indicator it takes over 20 seconds to load a chart...

    Looking for any help to be able and still use it but get down the load time... perhaps having it just load for the current day only? is that possible? Or is there a way to troubleshoot potential problems?

    Thanks for any help!

    #2
    Hello tshirtdeal,

    You can follow these performance tips below to get the best performance out of NinjaTrader:


    If the long load time is only seen with the custom script, then best will be to work with the author of the script to see if any changes can be made that will improve efficiency.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks Ryan,

      is there anyway to add a snippet in order to have the indicator produce the current day? would/could that help at all? I know there is :: if (!Historical) :: but i still want to see the values for the current day when I load new charts throughout the day...

      Thanks for any help!

      Comment


        #4
        Yes, there are probably a few changes you could make to improve the loading time and efficiency. Calculating only for the current day could be done with something like:

        if (ToDay(Time[0]) != ToDay(DateTime.Now)) return;
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thanks Ryan,

          Now I got another problem, I went to compile it but it says I have an error in pretty much every standard NT7 (locked) indicator because of the calling of the SMA in them... Went to open the SMA in edit to see but it is not even there anymore....

          any help is much appreciated...

          Comment


            #6
            Please send a note to support 'at' ninjatrader 'dot' com with a screenshot of the error messages you're getting within the compiler. In the subject, write Attn: RyanM.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Hey,

              is there away to use this code
              if (ToDay(Time[0]) != ToDay(DateTime.Now)) return;

              to look 2 days max back? I am assuming I need at least the number of bars to load in which the indicator relies on for a correct value correct?

              Thanks for any help!

              Comment


                #8
                Right, should ensure that there are enough bars to calculate the indicator.

                Yes, for this type of expression you may want to use the .net DateTime features, like Compare. This sample can help with general date / time help:


                Here is an example close to what you're looking for:
                if (DateTime.Compare(Time[0], DateTime.Now.AddDays(-2)) < 0) return;

                It says check bar time stamps, and if they are earlier than two days prior to your computer clock, then return out of OnBarUpdate.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  ahhh... thanks Ryan... I see what I did wrong now... works perfect for me and thanks for the help!

                  R.T.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by andrewtrades, Today, 04:57 PM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by chbruno, Today, 04:10 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post chbruno
                  by chbruno
                   
                  Started by josh18955, 03-25-2023, 11:16 AM
                  6 responses
                  436 views
                  0 likes
                  Last Post Delerium  
                  Started by FAQtrader, Today, 03:35 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post FAQtrader  
                  Started by rocketman7, Today, 09:41 AM
                  5 responses
                  19 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X