Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Swing Indicator is printing different value on Chart and NinjaScript

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

    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]

    Click image for larger version

Name:	NT.PNG
Views:	268
Size:	51.9 KB
ID:	1133489
    Click image for larger version

Name:	NT.png
Views:	324
Size:	567.8 KB
ID:	1133488

    #2
    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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    44 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    58 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    35 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    95 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    59 views
    0 likes
    Last Post PaulMohn  
    Working...
    X