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

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?
        BertrandNinjaTrader Customer Service

        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.
            BertrandNinjaTrader Customer Service

            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 wzgy0920, 04-20-2024, 06:09 PM
                    2 responses
                    27 views
                    0 likes
                    Last Post wzgy0920  
                    Started by wzgy0920, 02-22-2024, 01:11 AM
                    5 responses
                    32 views
                    0 likes
                    Last Post wzgy0920  
                    Started by wzgy0920, 04-23-2024, 09:53 PM
                    2 responses
                    74 views
                    0 likes
                    Last Post wzgy0920  
                    Started by Kensonprib, 04-28-2021, 10:11 AM
                    5 responses
                    193 views
                    0 likes
                    Last Post Hasadafa  
                    Started by GussJ, 03-04-2020, 03:11 PM
                    11 responses
                    3,235 views
                    0 likes
                    Last Post xiinteractive  
                    Working...
                    X