• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

zig zag method error

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

    zig zag method error

    I currently use the existing zig zag method

    int FirstUpswingHighPosition = ZigZag(DeviationType.Points, retracement, false).HighBar(0,1,100);

    However i modified the ZigZagindicator and called it ZigZagCustom. I now want to call the same method above using my ZigZag Custom indicator in the same way :

    int FirstUpswingHighPosition = ZigZagCustom(DeviationType.Points, retracement, false).HighBar(0,1,100);

    When i do this i get an error message that says "No overload for method 'zigZagCustom' takes '3' arguments"

    How do i call the original HighPosition Method with my modified ZigZagCustom indicator ?

    thank you,

    #2
    Originally posted by russ123 View Post
    I currently use the existing zig zag method

    int FirstUpswingHighPosition = ZigZag(DeviationType.Points, retracement, false).HighBar(0,1,100);

    However i modified the ZigZagindicator and called it ZigZagCustom. I now want to call the same method above using my ZigZag Custom indicator in the same way :

    int FirstUpswingHighPosition = ZigZagCustom(DeviationType.Points, retracement, false).HighBar(0,1,100);

    When i do this i get an error message that says "No overload for method 'zigZagCustom' takes '3' arguments"

    How do i call the original HighPosition Method with my modified ZigZagCustom indicator ?

    thank you,
    Take a look in the constructor and see,either there`s something`s missing there or some additional parameters added.

    This line you`d need:

    Code:
    return _indicator.ZigZag(input, deviationType, deviationValue, useHighLow);

    Comment


      #3
      Hello,

      I would like to check how did you make a custom version of the zigzag, did you do the Right click in the original and Save as to create a copy?

      If you had done this process, it should be identical to the original except for having a different name. If you had manually copied the code into a new document this may be the cause if you had missed a public statement for example.

      I would recommend removing the custom version, go back to the original version and Right click and Save as and give the file a new name.

      After doing this the new file will be open, just do a compile and then try the line over again from the other script.

      Doing this process should correct the error you are getting, just remember to comment out the call to the custom indicator during this process so you do not get additional errors.

      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment


        #4
        zig zag method

        I replaced the file and now call it the CustomZigZag indicator and the method call worked. however there is an other issue.

        The reason why i updated the ZigZag indicator and created my own CustomZigZag indicator is because the current ZigZag indicator reverses when it encounters a doji. In other words if the deviation value is .01, the Zig Zag indicator is supposed to change direction at a retracement of point .01. However the current indicator actually changes direction if the retracement is 0. So if there is a doji, the ZigZag indicator will change direction.

        This is because of lines in the zig zag code :

        bool isOverHighDeviation = (deviationType == DeviationType.Percent && IsPriceGreater(highSeries[1], (lastSwingPrice * (1.0 + deviationValue * 0.01))))
        || (deviationType == DeviationType.Points && IsPriceGreater(highSeries[1], lastSwingPrice + deviationValue));
        bool isOverLowDeviation = (deviationType == DeviationType.Percent && IsPriceGreater(lastSwingPrice * (1.0 - deviationValue * 0.01), lowSeries[1]))
        || (deviationType == DeviationType.Points && IsPriceGreater(lastSwingPrice - deviationValue, lowSeries[1]));


        If I change the "==" in the above code to ">" and "<", the ZigZag indicator correctly starts changing direction only when there is a retracement and not when there is a doji.

        The problem is that although it plots the zig zag correctly on the chart after the modification, the zig zag METHOD is not returning the correct values.

        ZigZag(DeviationType.Points, retracement, false).HighBar(0,1,100);


        This means additional lines of code need to be updated for the zigzag high bar and low bar methods to return the right values. I need to know what lines need to be updated. Please let me know this.

        Comment


          #5
          Hello,

          Can you please make the change in your custom version of the zigzag and then attach it so I can see what the issue is?

          I believe this is more than likely related to the generated code at the bottom, but I could be wrong so I would like to see the entirety of the code to make a judgment.

          You can attach just the script by clicking the Attach button and browsing to: Documents\NinjaTrader 7\bin\Custom\Indicator

          I look forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by GussJ, Today, 01:30 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by GARZONJ, Today, 12:25 PM
          3 responses
          13 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by RandanAL, Today, 11:53 AM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by yeshujbp, 07-21-2019, 02:40 PM
          2 responses
          35 views
          0 likes
          Last Post omololu
          by omololu
           
          Started by seagraph, Yesterday, 03:27 PM
          1 response
          28 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X