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 pechtri, 06-22-2023, 02:31 AM
            10 responses
            124 views
            0 likes
            Last Post Leeroy_Jenkins  
            Started by judysamnt7, 03-13-2023, 09:11 AM
            4 responses
            59 views
            0 likes
            Last Post DynamicTest  
            Started by ScottWalsh, Yesterday, 06:52 PM
            4 responses
            36 views
            0 likes
            Last Post ScottWalsh  
            Started by olisav57, Yesterday, 07:39 PM
            0 responses
            7 views
            0 likes
            Last Post olisav57  
            Started by trilliantrader, Yesterday, 03:01 PM
            2 responses
            22 views
            0 likes
            Last Post helpwanted  
            Working...
            X