Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Zigzag Programming; write to file export

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

    Zigzag Programming; write to file export

    Hello, I am trying to figure out how to work with zigzag data. Can someone please help me with the following or provide some example code so I can be guided the right way?

    I am transitioning from EasyLanguage, so please excuse any poorly structured syntax in this thread.

    1. I am using the default ZIGZAG indicator on CL set to 0.50pts per new zigzag line.

    2. I would like to export data from the zigzag transitions: time, high price (if zigzag up), low price (if zigzag down), and zigzag number (to answer the statement, "this is the n-th zigzag on the chart") into a CSV file.

    3. I would like to create an "automatic" fibonacci retracement based on recent zigzag highs/lows. How do I call the n-th zigzags to calculate this?

    If this indicator has already been created, then please link! If not, I will gladly supply my source to this forum.

    Thanks much!!

    #2
    Hello naked,

    One important thing to know when working with Zig Zag and similar indicators (Swing), is that they're repainting. Values accessed programatically will be different than what you see visually on a chart because of this. After future bars come in, the indicator is repainted and the values you see in the past are actually generated by values in the future. As such, you are likely to run into issues trying to get a useful real time value from it.

    If you want to purse writing information to a file, these samples can help:


    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    574 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    333 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
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X