Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How To Reference a Prior Swing Low - Zig Zag Indicator.

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

    How To Reference a Prior Swing Low - Zig Zag Indicator.

    Guys,

    Would appreaciate some help here with regards to the Zig Zag Indicator. I am looking to reference a prior Swing Low (Low 2 in the attached image - Not Low 1).

    Therefore, if I wanted to enter a trade when the price is > than Low 2 and of course Low 1. I believe I should use "instance" -

    instance - The occurrence to check for (1 is the most recent,
    2 is the 2nd most recent etc...)

    Is this correct? If so could you help me with an example of how it would be coded?

    Many thanks, Gaz

    #2
    Hello rabidsheep.

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    You are correct on the use of the instance. And example of this would be the following:
    Code:
    if(Close[0] > Low[Math.Max(0, ZigZag(DeviationType.Points, 0.5, false).LowBar(0, 1, 100))] && Close[0] > Low[Math.Max(0, ZigZag(DeviationType.Points, 0.5, false).LowBar(0, 2, 100))])
    {
    //Do  something.
    }
    For information on ZigZag() please visit the following link: http://www.ninjatrader.com/support/h...nt7/zigzag.htm

    Please let me know if I may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    123 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    104 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    82 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    102 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    83 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X