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

Using OnStartUp() and Plot() with an empty Chart

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

    #16
    No, Initialize() will always be called. That is how you are able to even see the indicator listings and their properties. Without Initialize() you would not know.

    The documentation has been amended as to when OnStartUp() will be called.
    Josh P.NinjaTrader Customer Service

    Comment


      #17
      Originally posted by NinjaTrader_Josh View Post
      No, Initialize() will always be called. That is how you are able to even see the indicator listings and their properties. Without Initialize() you would not know.

      The documentation has been amended as to when OnStartUp() will be called.
      How do I get that? Can I just download a fresh copy of documentation? Wait for next NT release?

      No emergency ... whatever the plan is works for me. I just want to know what the plan is.

      --EV

      Comment


        #18
        I think that there is a dynamic, perennially updated, online version of the NT Help?

        Comment


          #19
          You are correct -- I never think of that -- I just use the Help from the release.

          I just checked, since Josh said "The documentation has been amended as to when OnStartUp() will be called." The online help still has the old language.

          --EV

          Comment


            #20
            Changes to the help guide are available when there is a new release to the platform. You'll receive notification in the platform when a new version is available.
            Ryan M.NinjaTrader Customer Service

            Comment


              #21
              I just got to thinking about this a bit more.

              Will OnTermination() be called, even if OnStartUp() is not called?

              (Note: another thread assured us that OnTermination() would be called if, and only if, OnStartUp() had been called. I am just double checking that to make sure that this case was not overlooked when making that statement.)

              Does BarsRequired apply to plots as well as OnBarUpdate? Could the OP protect himself by setting BarsRequired = 1?

              What guarantees are there if Plot() is called before OnStartUp()?

              For example, if bars later become available, is it guaranteed that OnStartUp() will be called before Plot() will be called with bars available? Put another way, can Plot() safely assume there are no bars if OnStartUp() has not been called?

              --EV
              Last edited by ETFVoyageur; 01-21-2011, 07:14 PM.

              Comment


                #22
                Hello EV,

                I think your questions (or better the answers to your questions) are very important when using Plot(). The problem we (as NT users) have is that NT does not support Plot(). Make a search in the Help doc, it is not mentioned there. And experience shows that if NT does not support a feature you have to consider this (non-support) literally.

                My conclusion of this thread was to implement a check-routine in any of my Plot() implementations to be sure, that all resources needed are alive. I think that is save (but ugly), the worst thing that could happen is I don't see the plots I expect to see. That would be a hint that my concept fails but it is still better than just let "it" run into exceptions.

                Sometimes the NT support team is referring to Plot() as an alternative to the supported plotting routines because these supported capabilities are limitted and the graphical .NET universe is huge.
                Therefore my impression is: We could make some progress with this issue only if NT agrees to add Plot() to the officially supported features.

                Regards
                Ralph

                Comment


                  #23
                  Ralph,

                  > We could make some progress with this issue only if NT agrees to add Plot() to the officially supported features.

                  Yes, "supported" is an interesting concept at times. Especially when it comes to something that there is no way around, such as Plot(), that their own indicators use. I ocasionally get surprised at some of the things that are "unsupported".

                  Putting myself in their shoes, I can understand their position, at least a lot of the time. In the case of Plot() I would think that a compromise position might be sensible -- support the architectural aspect, such as when it gets called, but do not support whatever drawng you do from it -- the graphics universe is just too huge.

                  I suppose the safest thing to do when you think Plot() should not be called before OnStartUp() is to fake just that. Have OnStartUp() set a bool and have Plot() just immediately return if the flag is not set. I think that is what I shall do unless you see something wrong with that plan.

                  Perhaps looking over their own indicators that use Plot() would be instructional. One thing going through my head is wondering whether any of their own indicators that use Plot (e.g Heiken Ashi) have a similar bug. That Plot() routine does have a guard, but I do not know whether or not it works in your case.

                  -- EV

                  Comment


                    #24
                    EV, another indicator you can look at as an example that overrides the Plot() method is VolumeProfile.
                    AustinNinjaTrader Customer Service

                    Comment


                      #25
                      Originally posted by Ralph View Post
                      I think your questions (or better the answers to your questions) are very important when using Plot(). The problem we (as NT users) have is that NT does not support Plot().
                      Note that one of my questions was a valid question about supported things, and had nothing to do with Plot(). OnStartUp() and OnTermination() are both supported. Let me pose my question again:
                      • I had thought that a call to OnStartUp() was guaranteed for any instance that got brought up as an indicator (I know it does not happen for temporary objects the system constructs.)

                      • I was surprised to find that the indicator could be activated without calling OnStartUp() in the case where there are no data bars.

                      • Another thread recently assured us that OnTermination() would be called if, and only if, OnStartUp() had been called. I am just double checking that to make sure that this (no data) case was not overlooked when making that statement.

                      • Finally, the question: for an instance where OnStartUp() is not called, due to lack of data, will OnTermination() be called or won't it?

                      --EV

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by WHICKED, Today, 12:45 PM
                      2 responses
                      19 views
                      0 likes
                      Last Post WHICKED
                      by WHICKED
                       
                      Started by GussJ, 03-04-2020, 03:11 PM
                      15 responses
                      3,276 views
                      0 likes
                      Last Post xiinteractive  
                      Started by Tim-c, Today, 02:10 PM
                      1 response
                      8 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by Taddypole, Today, 02:47 PM
                      0 responses
                      5 views
                      0 likes
                      Last Post Taddypole  
                      Started by chbruno, 04-24-2024, 04:10 PM
                      4 responses
                      51 views
                      0 likes
                      Last Post chbruno
                      by chbruno
                       
                      Working...
                      X