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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      61 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      148 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      98 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X