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 Rapine Heihei, Today, 07:51 PM
      0 responses
      3 views
      0 likes
      Last Post Rapine Heihei  
      Started by frslvr, 04-11-2024, 07:26 AM
      5 responses
      96 views
      1 like
      Last Post caryc123  
      Started by algospoke, 04-17-2024, 06:40 PM
      6 responses
      49 views
      0 likes
      Last Post algospoke  
      Started by arvidvanstaey, Today, 02:19 PM
      4 responses
      11 views
      0 likes
      Last Post arvidvanstaey  
      Started by samish18, 04-17-2024, 08:57 AM
      16 responses
      61 views
      0 likes
      Last Post samish18  
      Working...
      X