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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      63 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      35 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      54 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      61 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      48 views
      0 likes
      Last Post CarlTrading  
      Working...
      X