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 Help

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

    ZigZag Help

    Will someone explain to me when a new zigzag high or low is actually formed? Is it after a certain number of bars? If my thinking is way wrong will someone just explain the actual technical ways it is calculated and plotted. Thanks!

    GT

    #2
    Hi GreenTrade,

    You can view the code for the ZigZag at "Tools>Edit NS>ZigZag"

    Also, here is the description: The ZigZag indicator shows trend lines filtering out changes below a defined level.

    Hopefully there are others that would like to give their input.
    TimNinjaTrader Customer Service

    Comment


      #3
      Current Deviation Value

      Hi,

      I want to display the deviation value above/below each bar.. Also want to display this value as the currentbar is forming..

      I'm new to this language so strangling to work out what is the name of the value is.
      I know that you have to set a reference deviation value so that when it is breached a
      blue line is plotted.

      And where in the code it is found?

      I want to use the DrawText object.

      example..
      DrawText("DeviationTag", currentdeviationValue, 0, 20,Color.Blue)

      The reason I want to do this is for learning pruposes..want to see exactly what is happening.

      There must be a Dynamic Deviation value as well as a value that is stored when the
      reference Deviation Value is breached.


      Cheers
      Bruce

      Comment


        #4
        Hi Bruce,

        Thanks for the post and welcome to the NinjaTrader forums!

        This page can help you with some code drawing tips.

        One thing you'll want to do is add + CurrentBar to the tag to allow uniquely tagged drawing objects. You also might want to base the Y position on bar objects, like highs or lows.
        DrawText("DeviationTag" + CurrentBar, currentdeviationValue, 0, High[0],Color.Blue);

        An example of using StdDev is available here:
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          ok thanks for the info..

          Can anybody tell me if I want to display the current deviation value..what is the name of the string or INT?

          As far as I can see the user inputs a reference value named 'Deviation Value'...this may be say 0.08 if using percentages as type.. The program obviuosly works out the current deviation value as
          each candle(bar) is forming. Once this 0.08 value is exceeded a blue line is drawn. So just need the name of the string of INT variable so I can print to screen.

          Thanks
          Bruce

          Comment


            #6
            You can edit the ZigZag source code if you want to see more info on how internal variables are defined. DeviationValue in this indicator is an input, so the value is only what a user types in when applying.

            [Description("Deviation in percent or points regarding on the deviation type")]
            [GridCategory("Parameters")]
            [Gui.Design.DisplayName("Deviation value")]
            public double DeviationValue
            {
            get { return deviationValue; }
            set { deviationValue = Math.Max(0.0, value); }
            }
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Editing Ninja Indicator

              Hi Ryan,

              Thanks for your help..

              I've worked out the deviation Values location..

              Have another question on how we can save and edited script.

              EG ZigZag.

              If I use the NInja editor and copy and paste code from the ZIGZAG indicator to a new indicator say named ZZ2 when I click save it looks like it saves it in the ninja folders as @ZZ2.cs where I can also see the @ZigZag.cs indicator but when I want to add my new ZZ2 to a chart the ZZ2 indicator is not listed.

              Is there something else I need to do?

              Cheers
              Bruce

              Comment


                #8
                Bruce, you would not only want to save your code, but press F5 in the editor to compile it into the custom assembly used to run your code at runtime, after this step your indicator should become selectable from the chart.
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Jon17, Today, 04:33 PM
                0 responses
                1 view
                0 likes
                Last Post Jon17
                by Jon17
                 
                Started by Javierw.ok, Today, 04:12 PM
                0 responses
                4 views
                0 likes
                Last Post Javierw.ok  
                Started by timmbbo, Today, 08:59 AM
                2 responses
                10 views
                0 likes
                Last Post bltdavid  
                Started by alifarahani, Today, 09:40 AM
                6 responses
                41 views
                0 likes
                Last Post alifarahani  
                Started by Waxavi, Today, 02:10 AM
                1 response
                20 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Working...
                X