Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Please check the 'Plot' method:Overflow error.

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

    Please check the 'Plot' method:Overflow error.

    I have read the forum re this error message I am getting:

    "Please check the 'Plot' method:Overflow error."

    My strategy is calling an indicator that does the simple plot. Perhaps it could be the synch issue Josh mentioned on the forum as this error occurs only intermittently and only when I first load the cs to the chart...and it recovers immediately if I refresh/F5.

    The indicator is checking Close[0] > 1....yet I still get the error on occasion...which is why I think it might be the synch issue.

    What code can I put in my strategy to avoid the error?

    Thanks.

    #2
    Probably some math overflow by a zero divide. You would need to isolate by adding try/catch blocks in your Plot method.

    Comment


      #3
      Dierk

      I think this has something to do with OnMarketData

      See code and time of error vs time of prints....i.e. the error occurs while lastTrade == 0 (8:09:28) and never occurs when none are zero...

      In other words, when I get an error it is only prior to printing of OK line to output window. This error does not occur all the time.

      Thanks
      Attached Files

      Comment


        #4
        Do you have the plot method overwritten? If so, then this is the cause of the problem. Please proceed as per my post below.

        Comment


          #5
          i had this code to overrinde plot

          i commented it out and still get the error

          also...i do get the error after OK is printed...

          sorry...i do not know how to do try or catch....will have to research.....do you have a link or example
          Attached Files

          Comment


            #6
            >> do you have a link or example
            Please scan the standard MS docs on C sharp.

            Comment


              #7
              RegressionChannel

              Dierk

              Now I have the same overflow error in the RegressionChannel indicator

              Should it not have the highlighted text I added in the screehshot to avoid a divide by zero error
              Attached Files

              Comment


                #8
                Not sure I follow.

                Comment


                  #9
                  this is the second indicator that generated an overflow error

                  so I checked for code that divides and then put in a check to return if the divisor was 0

                  so...should the code that I highlighted in the screenshot not be put in the NT RegressionChannel indicator

                  Comment


                    #10
                    We'll check. Thanks for making us aware.

                    Comment


                      #11
                      Dierk

                      Any progress on the RegressionChannel issue?

                      If you are going to use try/catch blocks to test, can you please post the code

                      Thanks

                      Comment


                        #12
                        There will be fix available with next update (next few days). Please be patient.

                        Comment


                          #13
                          I am patient...just curious...did not have reply...so....

                          Comment


                            #14
                            ok...the answer to my original overflow problem (i.e. not the regression channel overflow error) is that if the first plot is negative, I get the overflow error

                            I am using this code:

                            Add(new Plot(Color.Green, PlotStyle.Bar, "valUP")); // 0
                            Add(new Plot(Color.Maroon, PlotStyle.Bar, "valDN")); // 1
                            Plots[0].Min = 0;
                            Plots[1].Max = 0;

                            if ( x >= 0 )
                            valUP.Set(x);
                            else if ( x < 0 )
                            valDN.Set(x);

                            when x is negative on the first bar plotted (non-historical), then I get overflow error

                            if the first plot is positive, no error

                            the overflow only occurs on the first bar

                            if I remove the if and else stmts and the min/max stmts, and get a negative number, still get the error

                            I have coded around this so that I wait for a postive number before starting the plot and it works fine. I am posting this solution fyi and also would like someone to tell me why the error occurs on the first bar when it will plot negative numbers all day long after the first bar

                            thanks

                            Comment


                              #15
                              Please mail a simple as possible version of your indicator to "christian AT ninjatrader DOT com" and provide all details which are necessary to reproduce the issue.

                              Thanks

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              662 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              376 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              110 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              574 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              580 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X