This appears to be a bug. Has anyone seen this and even better, have a fix ?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Bug in Swing Indicator ?
Collapse
X
-
-
I changed my end date to that Wednesday, and it worked. (thursday/5 days to load has issues too?)Originally posted by BAltman View PostAttached 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 ?
Increasing my days to load to 10... fixed it also.
Comment
-
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
-
Hi Bertrand,Originally posted by NinjaTrader_Bertrand View PostBAltman, 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?
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
-
8/19 is the problem as a start date.Originally posted by BAltman View PostHi 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 ?
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
-
To fix it cosmetically at least -Originally posted by BAltman View PostThanks 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 :-)
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
-
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
579 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment