[ATTACH]n1133490[/ATTACH]
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Swing Indicator is printing different value on Chart and NinjaScript
Collapse
X
-
Swing Indicator is printing different value on Chart and NinjaScript
I was using Swing Indicator with Strength 3 for developing an Indicator. After a while I noticed that the values don't match up. I dug down, and found the problem. Swing indicator is showing one value on Chart but a different value in the Ninja Script. The value printed in NinjaScript is with Displacement of 3 I think. The problem can be noticed when Swing Indicator changes value. I am adding the Indicator that I am using to check the value, Screenshot of the Swing Indicator Settings (I am using the default settings) and a screenshot of the problem.
[ATTACH]n1133490[/ATTACH]
Tags: None
-
Hello fawzanalim, thanks for writing in.
The Swing needs at least "Strength" bars in one direction to print a new swing high or low value, so the Swing you are printing on the historical data had not formed yet and it is displaying the last swing high that was calculated. To get that swing value you would need to wait for at least "Strength" bars before reading the next value. This can be seen more clearly by testing with the Playback connection. This will let you replay the historical data in real time to see how indicators form in real time.
Please let me know if I can assist any further.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
596 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
556 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
554 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment