Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 ScottWalsh, Today, 06:52 PM
      4 responses
      32 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      4 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      19 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      6 views
      0 likes
      Last Post cre8able  
      Started by Haiasi, Today, 06:53 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X