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 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 jclose, Today, 09:37 PM
    0 responses
    4 views
    0 likes
    Last Post jclose
    by jclose
     
    Started by WeyldFalcon, 08-07-2020, 06:13 AM
    10 responses
    1,413 views
    0 likes
    Last Post Traderontheroad  
    Started by firefoxforum12, Today, 08:53 PM
    0 responses
    10 views
    0 likes
    Last Post firefoxforum12  
    Started by stafe, Today, 08:34 PM
    0 responses
    10 views
    0 likes
    Last Post stafe
    by stafe
     
    Started by sastrades, 01-31-2024, 10:19 PM
    11 responses
    169 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X