Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bug in Swing Indicator ?

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

    Bug in Swing Indicator ?

    Attached is a screen shot showing where the Swing indicator plotted an orange dot (swing low) at a price of 0 (lower right, 8/19 at 15:00).

    This appears to be a bug. Has anyone seen this and even better, have a fix ?
    Attached Files

    #2
    Originally posted by BAltman View Post
    Attached is a screen shot showing where the Swing indicator plotted an orange dot (swing low) at a price of 0 (lower right, 8/19 at 15:00).

    This appears to be a bug. Has anyone seen this and even better, have a fix ?
    I have the "odd" dot also
    Attached Files

    Comment


      #3
      Originally posted by BAltman View Post
      Attached is a screen shot showing where the Swing indicator plotted an orange dot (swing low) at a price of 0 (lower right, 8/19 at 15:00).

      This appears to be a bug. Has anyone seen this and even better, have a fix ?
      I changed my end date to that Wednesday, and it worked. (thursday/5 days to load has issues too?)

      Increasing my days to load to 10... fixed it also.

      Comment


        #4
        BAltman, thanks for pointing that out - I'll make sure to let development know this scenario so it can be tested as we update the studies for our next major platform update. Can you check sledge's input in the meantime and let me know if increasing the loaded data range would improve the outcome for you?

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          BAltman, thanks for pointing that out - I'll make sure to let development know this scenario so it can be tested as we update the studies for our next major platform update. Can you check sledge's input in the meantime and let me know if increasing the loaded data range would improve the outcome for you?
          Hi Bertrand,

          Changing the end date corrected the problem, but I am writing a custom indicator that uses Swing and I now know there are cases where it won't perform properly.

          Is there a time frame for the next major platform update where this might be fixed ?

          Comment


            #6
            Thanks for letting me know - I would unfortunately not have ETA for our next major update at this time, once there's more info we will for sure approach the community with details.

            Comment


              #7
              Originally posted by BAltman View Post
              Hi Bertrand,

              Changing the end date corrected the problem, but I am writing a custom indicator that uses Swing and I now know there are cases where it won't perform properly.

              Is there a time frame for the next major platform update where this might be fixed ?
              8/19 is the problem as a start date.

              If you use "end date = 8/19" and "days to load = 1", it happens.
              and you can increase by 1 , each item and it will continue to happen series: (8/20, 2)(8/21,3)...

              The problem appears to be at 16:00, a low was put in. the 15:00 bar has no idea for some reason. But as I pointed out earlier, starting on a date with out the issue it works.

              I think as long as you don't see the issue - it is fine. ie, have a date that doesn't start with the LOW/HIGH on the 16:00 EST bar.

              Comment


                #8
                Thanks Sledge - that's a good clue for when I debug and fix it

                I've got other things to do first, but I'll post the fix (if I fix it :-)

                Comment


                  #9
                  Originally posted by BAltman View Post
                  Thanks Sledge - that's a good clue for when I debug and fix it

                  I've got other things to do first, but I'll post the fix (if I fix it :-)
                  To fix it cosmetically at least -



                  Code:
                  					if (isSwingLow)
                  					{
                  						currentSwingLow = swingLowCandidateValue;
                  						for (int i=0; i <= strength; i++)
                  							SwingLowPlot.Set(i, currentSwingLow);
                  					}
                  					else if (Low[0] < currentSwingLow)
                  					{
                  						currentSwingLow = double.MaxValue;
                  						SwingLowPlot.Reset();
                  					}
                  					else
                  [I][COLOR="Blue"]					{
                           					if (currentSwingLow != 0.00)
                  							SwingLowPlot.Set(currentSwingLow);
                  					}[/COLOR][/I]


                  And also at the HIGH

                  Code:
                  					if (isSwingHigh)
                  					{
                  						currentSwingHigh = swingHighCandidateValue;
                  						for (int i=0; i <= strength; i++)
                  							SwingHighPlot.Set(i, currentSwingHigh);
                  					}
                  					else if (High[0] > currentSwingHigh)
                  					{
                  						currentSwingHigh = 0.0;
                  						SwingHighPlot.Reset();
                  					}
                  					else 
                  [I][COLOR="Blue"]					{
                  						if ( currentSwingHigh != 0.00 )
                  							SwingHighPlot.Set(currentSwingHigh);
                  					}[/COLOR][/I]

                  Comment


                    #10
                    Thanks for the code Sledge, but I am not using this indicator on a chart (I only showed the attached screen shot to demonstrate the bug).

                    I need to fix the reason that currentSwingLow and currentSwingHigh sometimes come back as 0.0 - I'm using these values in a custom indicator that uses the Swing indicator beneath it...

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    581 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    338 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    103 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    554 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    552 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X