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

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 Tim-c, Today, 10:58 AM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by traderqz, Yesterday, 09:06 AM
    4 responses
    24 views
    0 likes
    Last Post traderqz  
    Started by traderqz, Today, 12:06 AM
    4 responses
    7 views
    0 likes
    Last Post traderqz  
    Started by Mongo, Today, 11:05 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by f.saeidi, Today, 10:19 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X