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

Issue with using Add() in NT7 Indicator

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

    Issue with using Add() in NT7 Indicator

    After having used
    Add(PeriodType periodType, int period)
    In my NT 7 Indicator.
    When I switch symbols a few times from EURUSD to EURJPY etc.
    Eventually my chart becomes blank.
    Is there something I should do after I finish using Add?
    Do I need to dispose of the BarsArray?
    Thoughts?

    #2
    Hello trader3419,

    Thank you for your post.

    There should be no need to dispose of the called instrument series in this case.

    Do you receive an error on screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?

    I look forward to your response.

    Comment


      #3
      Thanks for your response.
      I actually got no errors but a few pairs were blank if I changed to them.

      Keep in mind that I overloaded the dispose function.
      Also once I disposed of those instruments I stopped getting blank charts.
      I just added in BarsArray[1].Dispose();
      BarsArray[2].Dispose();

      Even though I stopped getting the issue, is there any reccomendations you have?

      Comment


        #4
        Hello trader3419,

        Thank you for your response.

        I would not have any recommendations here, I am glad that you found a solution here though.
        I will test and report this unexpected behavior as a bug.

        Comment


          #5
          Originally posted by trader3419 View Post
          Add(PeriodType periodType, int period)
          What PeriodType and value are you using here? Can you copy and paste each Add() used?

          Comment


            #6
            Add("$EURUSD",PeriodType.Minute,5);
            Is an example.
            Also a 10 minute one

            Comment


              #7
              Hello trader3419,

              Thank you for your response.

              Do you have a workspace that you were testing this on that I may test?

              You can send over your workspace by going to the Control Center-> Help-> Mail to Platform Support-> ensure the Workspaces option is enabled.

              Please place 'ATTN: Patrick H - 1504586' in the subject line.

              Comment


                #8
                I don't have the ability to upload my workspace at this time.
                But I am positive the issue arises from using Add() in the initalize function.
                while overloading the dispose function.
                and then switching around pairs a few times (I think the same pair you added).
                Then eventually that chart goes blank while on live data

                Comment


                  #9
                  Hello trader3419,

                  So disposing resolves the matter or causes the matter?

                  Comment


                    #10
                    overloading the dispose function without actually disposing of the BarsArray[1] and [2]
                    Is when I had the issue.I was only disposing of other things not the BarsArray.

                    but once I added in the 2 lines of code to dispose of BarsArray it fixed the issue

                    Sorry if that wasn't clear

                    Comment


                      #11
                      Originally posted by trader3419 View Post
                      overloading the dispose function without actually disposing of the BarsArray[1] and [2]
                      Is when I had the issue.I was only disposing of other things not the BarsArray.

                      but once I added in the 2 lines of code to dispose of BarsArray it fixed the issue

                      Sorry if that wasn't clear
                      Did your overloaded dispose call base.dispose()?

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by DanielTynera, Today, 01:14 AM
                      0 responses
                      2 views
                      0 likes
                      Last Post DanielTynera  
                      Started by yertle, 04-18-2024, 08:38 AM
                      9 responses
                      40 views
                      0 likes
                      Last Post yertle
                      by yertle
                       
                      Started by techgetgame, Yesterday, 11:42 PM
                      0 responses
                      12 views
                      0 likes
                      Last Post techgetgame  
                      Started by sephichapdson, Yesterday, 11:36 PM
                      0 responses
                      2 views
                      0 likes
                      Last Post sephichapdson  
                      Started by bortz, 11-06-2023, 08:04 AM
                      47 responses
                      1,615 views
                      0 likes
                      Last Post aligator  
                      Working...
                      X