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 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 Segwin, 05-07-2018, 02:15 PM
            14 responses
            1,789 views
            0 likes
            Last Post aligator  
            Started by Jimmyk, 01-26-2018, 05:19 AM
            6 responses
            837 views
            0 likes
            Last Post emuns
            by emuns
             
            Started by jxs_xrj, 01-12-2020, 09:49 AM
            6 responses
            3,293 views
            1 like
            Last Post jgualdronc  
            Started by Touch-Ups, Today, 10:36 AM
            0 responses
            13 views
            0 likes
            Last Post Touch-Ups  
            Started by geddyisodin, 04-25-2024, 05:20 AM
            11 responses
            63 views
            0 likes
            Last Post halgo_boulder  
            Working...
            X