ZigZag expanded in time (code) - EasyLanguage Programming | futures io social day trading
futures io futures trading

ZigZag expanded in time (code)
Updated: Views / Replies:5,978 / 3
Created: by Doctor Leo Attachments:1

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors – all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you don’t need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

ZigZag expanded in time (code)

  #1 (permalink)
Trading Apprentice
St. Petersburg, Russia
Trading Experience: Advanced
Platform: Multicharts
Favorite Futures: spot fx, currency futures, GC, ES
Posts: 30 since Nov 2010
Thanks: 6 given, 17 received

ZigZag expanded in time (code)

Hello everybody,

just thought the following code could be of interest for someone. It is a representation of zigzag, not in form of the well-known lines, but exactly the value of this indicator on each bar. Therefore you can follow its move during the forming of the most recent span, not only after a reversal occurs. The indicator uses two data streams: data1 is used for plotting and data2 — for determining the swing criterion. By default if is equal to 1 ATR of data2. The other lines on the chart are 2 standard errors from the uppermost or lowermost line (depending on the direction) and target levels for upwards and downwards movements. I hope the parameters are self-explanatory, but if you're in trouble please feel free to ask.

The indicator uses a function named __zigzagtrue_stddev__, please make sure the name is exactly that.

input: period(numericSimple), factor_atr(numericSimple), factor_stddev(numericSimple), dir(numericRef), atr(numericRef), sd(numericRef);

var: xhigh(high), xlow(low);

xhigh = maxlist(high, xhigh);
xlow = minlist(low, xlow);

atr = avgtruerange(period) of data2 * factor_atr;
sd = stderror(close, period) of data2 * factor_stddev;

if low <= xhigh - atr and dir = 1 then begin
	dir = -1;
	xlow = low;

if high >= xlow + atr and dir = -1 then begin
	dir = 1;
	xhigh = high;

if dir = -1 then begin
	value1 = xlow;
if dir = 1 then begin
	value1 = xhigh;

__zigzagtrue_stddev__ = value1;
Now the indicator itself:

input: period(20), factor_atr(2), factor_stddev(2), retracement(0.5);

var: xhigh(high), xlow(low), atr(0), dir(1), sd(0);

value1 = __zigzagtrue_stddev__(period, factor_atr, factor_stddev, dir, atr, sd);

if dir = -1 then begin
	setPlotColor(1, red);
	if dir[1] = 1 then value2 = value1 - atr;
	value3 = value1 + atr * retracement;
	value4 = value1 + sd;
	setPlotColor(2, red);
	setPlotColor(3, red);
	setPlotColor(4, white);
if dir = 1 then begin
	setPlotColor(1, yellow);
	if dir[1] = -1 then value2 = value1 + atr;
	value3 = value1 - atr * retracement;
	value4 = value1 - sd;
	setPlotColor(2, yellow);
	setPlotColor(3, yellow);
	setPlotColor(4, white);

If this stuff is apt for anyone please share your experience, would love also to hear about how this behaves on other instruments, in particular on index futures.

Hope I haven't dubbed someone else's work here on the forum.

Attached Thumbnails
ZigZag expanded in time (code)-screen-shot-2010-12-23-22.08.20-.png  
Reply With Quote
The following user says Thank You to Doctor Leo for this post:
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

  #3 (permalink)
Site Administrator
Manta, Ecuador
Trading Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
Big Mike's Avatar
Posts: 47,019 since Jun 2009
Thanks: 29,995 given, 87,523 received

Thanks for sharing. Have you looked at SuperTrend? It seems similar.



Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
  #4 (permalink)
Trading Apprentice
St. Petersburg, Russia
Trading Experience: Advanced
Platform: Multicharts
Favorite Futures: spot fx, currency futures, GC, ES
Posts: 30 since Nov 2010
Thanks: 6 given, 17 received

No, I hadn't seen your code before posting mine, no kidding Seriously, the idea is the same except that I use separate data streams which sometimes allow for using interesting solutions like mixing up instruments or using artificial indices, etc.

Reply With Quote


futures io > > > > > ZigZag expanded in time (code)

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now

Pro Trader vs Pro Athlete w/Brannigan Barrett @ Habitus Capital

Elite only

Similar Threads
Thread Thread Starter Forum Replies Last Post
N7 ZigZag modification ceramictilepro NinjaTrader Programming 12 May 3rd, 2012 09:17 AM
How to get the High/Low from the ZigZag indicator in my strategy? NinjaStrategies NinjaTrader Programming 12 July 30th, 2011 11:45 AM
Time remaining code for candlestick chart NJ cattlefitter NinjaTrader 3 July 20th, 2011 05:42 PM
Indicator to record H, L, Swing, Range, ZigZag jungian NinjaTrader Programming 5 June 21st, 2010 04:11 AM
Pivots, ZigZag, Swing Issues hondo69 The Elite Circle 4 November 20th, 2009 11:30 PM

atr, code, data, dow, easylanguage, futures, index futures, indicator, indicators, information, multicharts, neoticker, programming, retracement, retracements, supertrend, swing, tradestation, white, zigzag

All times are GMT -4. The time now is 02:42 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432 WhatsApp Business, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2019-05-19 in 0.19 seconds with 15 queries on phoenix