Repaints Optuma Gann ZigZag For ThinkOrSwim

Repaints

WarEagle

New member
Well, I'm no coding genius but here is my attempt to modify the existing ZigZagHighLow indicator from TOS. This is my first time to work with thinkScript so while I removed obvious items like unnecessary inputs this is not as efficient as it could be. I simply edited the conditions of the Uptrend and Downtrend states and let the ZigZag code do the rest.

As it stands this will only plot a 2 day swing. Gann initially wrote in his rules to use a 3 day swing chart but then later, as documented by Robert Krausz in his book "A WD Gann Treasure Discovered", he changed that recommendation to a 2 day swing chart. I find the 2 day works perfectly for me. An input could be added to allow the user to select the number of consecutive highs or lows required but I did not do that here since it would take more time in code edits and I don't really need it personally. If anyone would like to improve on this by adding that feature then that would be great.

The best I can tell it is working correctly. If you use this and see a problem then let me know.
https://usethinkscript.com/threads/optuma-gann-swing-for-thinkorswim.14574/

Cheers
 
Last edited by a moderator:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

this is great work but sometimes i also use 3 to 5 bars to reduce noise, is it possible to make this customizable?
 
Well, I'm no coding genius but here is my attempt to modify the existing ZigZagHighLow indicator from TOS. This is my first time to work with thinkScript so while I removed obvious items like unnecessary inputs this is not as efficient as it could be. I simply edited the conditions of the Uptrend and Downtrend states and let the ZigZag code do the rest.

As it stands this will only plot a 2 day swing. Gann initially wrote in his rules to use a 3 day swing chart but then later, as documented by Robert Krausz in his book "A WD Gann Treasure Discovered", he changed that recommendation to a 2 day swing chart. I find the 2 day works perfectly for me. An input could be added to allow the user to select the number of consecutive highs or lows required but I did not do that here since it would take more time in code edits and I don't really need it personally. If anyone would like to improve on this by adding that feature then that would be great.

The best I can tell it is working correctly. If you use this and see a problem then let me know.
https://usethinkscript.com/threads/optuma-gann-swing-for-thinkorswim.14574/

Cheers
Hi, was the code cut from the post when the thread was moved to its own topic for the finished indicator? Does anyone have it?
 
this is great work but sometimes i also use 3 to 5 bars to reduce noise, is it possible to make this customizable?

Hi, can you repost the code for this script if you still have it saved? The code seems to have been lost from the original post by the author.
 
I think there are better swing indicators out there. But seems that the repaint issue could be fixed by using [1] for the previous bar .
 
Last edited:
I think there are better swing indicators out there. But seems that the repaint issue could be fixed by using [1] for the previous bar .
Using the previous bar will correct MTF repainters and current bar repainter.
No, using previous bar does not fix the repainting issues of any swing indicators.

Think about it:
When the swing reverses before reaching the next Gann Swing pattern. That very pretty uptrending zigzag that started several bars ago; is going to be erased and replaced with a downtrended zigzag when an even lower Gann Swing pattern forms.

It is built into the DNA of swing studies.
 
So I guess, in order to keep from repainting a two bar pattern swing high you would have to wait for the third bar to finish. A three bar pattern would require the fourth bar to finish ect… that way you could measure your fib from the the pattern high low to project zones into the future.
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
491 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top