Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ZigZag example error...

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

    ZigZag example error...

    I'm trying to run the example in NT6.10(Live) help for zigzag, and I get an error. This is the help example:

    // Prints the high price of the most recent zig zag high
    Print("The high of the zigzag bar is " + High[Math.Max(0, ZigZag(DeviationType.Points, 0.5, false).HighBar(0, 1, 100)]));

    This is the error I get when trying to compile:

    NinjaScript File Error Code Line Column
    Strategy\StochC.cs ) expected CS1026 - click for info 58 122
    Strategy\StochC.cs ; expected CS1002 - click for info 58 124
    Strategy\StochC.cs Invalid expression term ']' CS1525 - click for info 58 124
    Strategy\StochC.cs ; expected CS1002 - click for info 58 125
    Strategy\StochC.cs Invalid expression term ')' CS1525 - click for info 58 125
    Strategy\StochC.cs ) expected. 57 121
    Strategy\StochC.cs Statement expected. 57 122

    I've tried adding/removing ) and ] ...nothing works. Still same error.

    #2
    got it

    Print("The high of the zigzag bar is " + High[Math.Max(0, ZigZag(DeviationType.Points, 0.5, false).HighBar(0, 1, 100))]);

    So there's a mis-print in ZigZag example in help file, in case you weren't aware. It shows:

    ...100)]));

    when it should be

    ...100))]);

    Comment


      #3
      Thanks for mentioning the typo. Will look into fixing it.
      Josh P.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      648 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      574 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X