Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modified Zig-zag to plot to most recent swing value

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

    Modified Zig-zag to plot to most recent swing value

    Is there a version of the Zigzag indicator ( or can I easily tweak the code ) such that when there is for example several bars with the same consecutive extreme value ( such as micro triple-top or micro triple-bottoms), the zigzag will plot not to the 1st instance but to the most recent instance of that value?

    #2
    Hello,

    Thank you for the question.

    I am not entirely sure how hard it would be to accomplish what you are trying to do, mainly the logic of determining the second instance instead of the first like you want.

    You can edit the original ZigZag to your liking, any of the stock indicators in fact.

    You would need to make a duplicate of the origianl before you can edit it, you can do that by doing the following:

    Click Tools -> Edit NinjaScript -> Indicator -> ZigZag and open it.
    In the NinjaScript window, Right click and choose Save As.
    Give it a new name.
    The NinjaScript window that is already open will now be the new file.

    From here you can determine exactly what you need to change and after compiling you will see the new indicator listed in your indicators list with whatever name you gave it.

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

    Comment


      #3
      Yeah, I've been trying to do that but have not yet figured out what to change in the code, to do this. I've seen some closed-source indictors that do it, but so far no open-source ones.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      144 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      70 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      125 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      78 views
      0 likes
      Last Post PaulMohn  
      Working...
      X