Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

zigzag problem

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

    zigzag problem

    It seems to me that in the section of the zigzag indicator "#region Miscellaneous" there is a function missing!!

    I can use

    public int HighBar(int barsAgo, int instance, int lookBackPeriod)

    But

    public int LowBar(int barsAgo, int instance, int lookBackPeriod)

    Does not work! It gives me the low of my last candle!

    For both functions the instance is also not working. It's not giving me the previous zigzag high.


    What am I doing wrong, or what could be te problem?

    Greetings,

    #2
    Will look into this.
    RayNinjaTrader Customer Service

    Comment


      #3
      zigzag

      Ok thx in advance !


      double swingbar3 = (Low[Math.Min(0, ZigZag(DeviationType.Points, 1.75, true).LowBar(0,1,500))]);

      Print("2# swingbar Low" + swingbar3);

      Does not show me the previous swinglow price (as with the swinghigh), but the low of the forming candle.
      Last edited by Creamers; 07-31-2008, 11:24 AM.

      Comment


        #4
        Your code won't work simply because of the use of Math.Min(). If ZigZag() returns any number other than its -1 state it your Math.Min() will force it to 0 because 0 will always be lower than any bar #. In terms of the -1 state everything will become screwed up because you will now be referencing LOW[-1].

        You will want to use Math.Max as shown in the Help Guide article for ZigZag.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          thx

          Damn, My Fault !!!! I really thought there was a function missing, but thanks very much!!

          ZigZag(DeviationType.Points, 1.75, true).LowBar(0,1,500)
          LowBar(x, instance , x)

          How to use LowBar if I want (not the last) but second last swing bar? Alter instance ?

          Greetings from the netherlands,

          Comment


            #6
            Yea. Alter the instance.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            571 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            331 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            549 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            549 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X