ZigZag EA help needed: This makes money from repainted new lines.

 

Note: So that we are clear, using the 5 digit MT4 system, I call them micro-pips or the 10 cent pips to describe things. That is, pips means 4 digit system pips, micro-pips are the 5 digit system of pips.

We all know that the ZigZag Indicator almost always repaints the newest line drawn. Often it will repaint or grow this new line by 500-1,000 micro-pips. Almost always it retraces from the point where the line first appears by 50-200 or more micro-pips.

Everyone seems to complain about this repainting issue. I see it is VERY profitable for scalping.

I very successfully MANUALLY trade the Zigzag Indicator, by setting a pending LIMIT order "a number" of pips from where the new line first forms - the number of pips away for the limit order price depends on volatility and TimeFrame used. Because almost all the Zigzag's new lines repaint (get longer from when first appearing), I set my TakeProfit assuming a minimum repaint level and based on volatility.

That is, depending volatility and TimeFrame, the pending limit order I set 50 - 200 micro-pips (5-20 of the 4 digit pips) away from where the line is first visible (mostly I am using the 1M and 5M TimeFrames). This pending limit order getting hit happens almost all the time, depending on how greedy I am for maximum pips profit. Some trade set-ups I miss because price did not retrace enough from where the line first appears. I cancel these pending orders when the line becomes set and an entirely new line has begun to form, or if too much time has passed.

In my MANUAL trading this system, I generally use a multi-purpose type Trade Manager EA to set the Breakeven+20 micro-pips when price hits the price of where the original line forms and begins to be repainted longer, and thereafter have it manage the trade with a 20 micro-pips trailing stop. Almost all repainted Zigzag lines repaint by more than 20 micro-pips!

Example 1: Assume EUR:USD forms a new line DOWN at the price 1.40000, in a relative quiet market I will set a SELLLIMIT order at 1.40050 .....in a more vigorous market I will set the SELLLIMIT order at 1.40200. I will have the multi-purpose Trade Manger EA I use in manual trading to set a Stop at BreakEven+20 micro-pips when price again hits 1.40000 and thereafter a trailing stop of 20 micro-pips.

Example 2: Exactly same as Example 1, but I set the trailing stop of 20 micro-pips to start from repainted 50-200 micro-pips from the first paint. That is, if I set the SELLLIMIT order at 1.40050, then the Breakeven+20 micro-pips is set at 1.40020 when price hits 1.40000 again and I set the 20 micro-pips trailing stop to begin from at 1.39950.

Manually trading this system gets me 100-200 micro-pips about 9 out of 10 times.The other 1 out of ten times were me being a coward, losing faith in the set-up and closing the trade for far too small a profit, and very occasionally a tiny loss.

I have searched the Elite section for such an EA that works with the ZigZag repainting issue - but I can't find one.

I would like to build such an EA; even though my skills are not much better than basic, I have built EAs in the past.

This EA would need to do the following I believe:

1 Expire pending LIMIT orders after a "extern int" number of bars....for those few times that there hasn't been such a retrace to hit the order price.

2 Set the LIMIT order price in pips away from where the new Zigzag line first appears, using a formula that averages most recent ZigZag volatility. This formula should be perhaps an average of the repaints of the last 4-5 Zig Zags.

3 The options of how to deal with break even points, and take profit issues. I would like the option to set the trailing stops from various possible positions.

4 The option of adding in RVI as a filter. That is, I am much more aggressive with my TakeProfit targets when the move is supported by RVI.

My first challenge is how to know the point at which a new line has been formed. That price at which the new line is formed is the framework from which the pending LIMIT orders and take profit issues get set.

Any assistance would be greatly appreciated. Especially is such an EA already exists.

I only joined Elite section today, by all means point out to me if I have posted this in the wrong place.

 

Hi dancingphil,

As I know - there are many EAs based on zigzag: in elite section - all Goldwarrior versions; in public - many others. Most of them are here by links to download (incl public EAs): https://www.mql5.com/en/forum/176044

How they (EAs or traders) are dealing with "last leg of zigzag is not valid and may be changed by direction"?

Differently ...

Some EAs - opens the additional trade with opposite direction with more high lot size, or in opposite direction with same lot size using CCI (Goldwarrior), some EAs - using many other indicators for confirmation.

You can look at Goldwarrior EA as it is classical EA concerning zigzag.

 

@ NewDigital, thank you for your reply.

I am continuing to review those EAs, but from what I can see, they all seek to ignore the repainting new line of the Zigzag. My approach is to ignore all firm and set ZigZag lines and to only be interested in the repainting new line.

My manual trading system I wish to make into an EA is only interested in the price-action as it almost always flip-flops over the point a new line is formed. In fact, the only interest my system has in the Zigzag is to set the most likely direction to trade - that is, in favor of the likely repaint.

It would be a great help for me to understand the Indicator's code and to print on the chart in some way the price at the very moment at which a new line is formed. From that price I feel I can code an EA to auto-trade the open and close of trades.

I have coded EAs, but my skill is still quite primitive.

For now, I have no experience in reading indicator/buffer code and making it do EA stuff.

Everything revolves around the price the new line is first formed.

Any and all help greatly appreciated.

 

Hi dancingphil,

Look at this thread https://www.mql5.com/en/forum/173514 (started from the first post) - it is some explanation about how to use zigzag's input (and how it was coded.

 
dancingphil:
@ NewDigital, thank you for your reply.

I am continuing to review those EAs, but from what I can see, they all seek to ignore the repainting new line of the Zigzag. My approach is to ignore all firm and set ZigZag lines and to only be interested in the repainting new line.

My manual trading system I wish to make into an EA is only interested in the price-action as it almost always flip-flops over the point a new line is formed. In fact, the only interest my system has in the Zigzag is to set the most likely direction to trade - that is, in favor of the likely repaint.

It would be a great help for me to understand the Indicator's code and to print on the chart in some way the price at the very moment at which a new line is formed. From that price I feel I can code an EA to auto-trade the open and close of trades.

I have coded EAs, but my skill is still quite primitive.

For now, I have no experience in reading indicator/buffer code and making it do EA stuff.

Everything revolves around the price the new line is first formed.

Any and all help greatly appreciated.

Hi Dancing Phil,

Thanks for sharing,

Is there any way you could show us some statements of your trading using this method, also maybe some charts explaining how you are trading this method, think i understand, just want to be sure.

 

@ MrTools, here is a missed chance - because price thumped hard through the beginning of the new line.

So only an EA that did market orders in favor of the break when a new line is created could make the scalp. Good for 20 pips anyway.

But what I will capture for you in the next pic will show a retrace from the new line back to a limit order, which then profits from the repaint price action. This style EA with LIMIT orders will get the extra pips profit of the distance the limit order's price has retraced back from when the line first forms.

Files:
 

I've never been one to get upset about lost opportunity - I'd always prefer to lose a chance than to lose money.

Having said that, this very next Zag in the charts shows me to be missing out on a lot by using Limit orders, rather than market orders when a line first forms.

This next pic shows the new line forming at 1.33820. I set a BUYLIMIT order at 1.33730, which did not get hit on a retrace. But after a few bars, price exploded in favor of the repainted new line to put 250 micro-pips since it first formed.

So, my attempt to show you two trade set-ups, have demonstrated I missed out on some serious pips. The first pic went onto make 300 micro-pips AFTER the new line, the second pic (so far) has improved 250 micro-pips after the new line formed.

Perhaps at least the option in the EA of choosing Market and Limit orders would be best.

Files:
 

This pic shows the trade set-up that did work....but I cocked it up anyway because I had my trade manager set wrong, it closed the trade in profit by only 5 pips, when there was a LOT more juice in it.

The new Zag line started at 1.33800, and it then retraced back to hit the SELLLIMIT order at 1.33870. Sadly for me, my trade manager EA had the wrong settings in it (laziness on my part), and it only took 5 pips of profit...eg, closed before any of the repainted action was had.

Files:
 

@ MrTools, very happy to help with the charts issue.

London session is open now, for sure there will be some action worth working with.

Back in an hour or so.

This makes me a lot of pips each day, but it gets boring waiting for that moment that new lines first get created. I'd rather manage a live trade than wait for every potential set-up.

 

This thread is now getting sorted out at this one : https://www.mql5.com/en/forum/181053 for anyone interested.