Forex Factory (https://www.forexfactory.com/)
-   Platform Tech (https://www.forexfactory.com/forum/69-platform-tech)
-   -   Creating an EA using a zigzag strategy (https://www.forexfactory.com/thread/498371-creating-an-ea-using-a-zigzag-strategy)

TradeWynds Aug 7, 2014 4:21pm | Post# 1

Creating an EA using a zigzag strategy
 
I'm considering creating an EA based on the zigzag or a variation of the zigzag.

The EA would trade D1, H4, H1, M30 and M15 charts.

Only one trade at a time until breakeven.

All entries would be entered on M1 with a 10 pip + spread stop loss.

The filtering, entry and exit conditions are established.

If you have a zigzag strategy and would be interested in working together, let's explore the possibilities.

tdhowl Aug 7, 2014 7:06pm | Post# 2

Hi TradeWynds,

I tried testing and trading extensively with the zigzag indicator. Trading with the zigzag indicator alone, I found that it is unstable in all market conditions. I also tried testing non repainting indicators on lower timeframes, and also there is a whipsaw effect.. meaning.. you enter a position on a lower timeframe, and soon after price goes the other way.. so the position would be closed at a loss. Both repainting, and non repainting indicators have there disadvantages. That being said, combining the zigzag indicator with multiple other indicators for confirmation on a higher timeframe like the hour 4 may produce good results. I think I'm having better results since I started using higher timeframes. If you think I'm wrong let me know. Good Luck- TD

TradeWynds Aug 7, 2014 8:16pm | Post# 3

Hi TradeWynds, I tried testing and trading extensively with the zigzag indicator. Trading with the zigzag indicator alone, I found that it is unstable in all market conditions. I also tried testing non repainting indicators on lower timeframes, and also there is a whipsaw effect.. meaning.. you enter a position on a lower timeframe, and soon after price goes the other way.. so the position would be closed at a loss. Both repainting, and non repainting indicators have there disadvantages. That being said, combining the zigzag indicator with multiple...
Hi TdHowl,

Did you include in your research what others were doing with zigzags, and if so, was anyone consistently profitable?

hayseed Aug 7, 2014 8:31pm | Post# 4

a variation of the zigzag.
//------

hey tradewynds..... if it's not something you prefer to keep private, what do you mean by 'a variation of the zigzag' .......h

TradeWynds Aug 7, 2014 9:23pm | Post# 5

{quote} //------ hey tradewynds..... if it's not something you prefer to keep private, what do you mean by 'a variation of the zigzag' .......h
That was more of a question. I know how to filter through different timeframes
to make an entry on M1. I have very little experience with zigzag indicators and
any any variations of their usage.

tdhowl Aug 7, 2014 10:41pm | Post# 6

Hi TradeWynds,

I had read what a super profitable trader stated was his strategy.. He stated that he always starts from the highest possible timeframe, and calculates to the lowest timeframe the perfect moment to enter a trade. This gentleman uses the zigzag to do this I think and he possibly uses other indicators too. I do not know his exact strategy.. he would not state it.. but i can tell you that he is way above my trading ability at this time and appears to make tens of thousands of percentage gains in a year with smooth equity curve. I would be filthy rich if I can only trade as 1% as well as he does! I got to keep trying. If I become afraid to fail, then I don't believe I will ever have the opportunity to succeed.

TradeWynds Aug 7, 2014 11:04pm | Post# 7

Hi TradeWynds, I had read what a super profitable trader stated was his strategy.. He stated that he always starts from the highest possible timeframe, and calculates to the lowest timeframe the perfect moment to enter a trade. This gentleman uses the zigzag to do this I think and he possibly uses other indicators too. I do not know his exact strategy.. he would not state it.. but i can tell you that he is way above my trading ability at this time and appears to make tens of thousands of percentage gains in a year with smooth equity curve. I would...
I start every trade as an M1 momentum trade.

The trick now is discovering if zigzags can help in defining a reliable pattern on higher timeframes.

whitearrow Aug 8, 2014 12:23am | Post# 8

1 Attachment(s)
This should get you started, but you are going to need something more. The Attached file is in Ea format, it will display 10 Fractals that coincide 4 hr downwards to 1 Min exact resolution. It could Identify, the zigzag you want to be looking at. Something I was thinking about
=======

double permSwing[9][6]; // first dimension is Period second is value of swing
double permIndex[9][6]; // first dimension is period second is time of swing
int chanTimes[9]={1,5,15,30,60,240,1440,0,0}; // which time frames you would like to populate
int chancount=3; //Number of time frames from above array to populate
void zigZag()
{
for(int j=0;j<chancount;j++)
{
int found=0;
int i=0;
while(found < 4) //finds last four zigzag swings
{
if(iCustom(NULL,chanTimes[j],"ZigZag",9,5,3,0,i)!=0)
{
permSwing[j][found]=iCustom(NULL,chanTimes[j],"ZigZag",9,5,3,0,i);
permIndex[j][found]=iTime(NULL,chanTimes[j],i);
found++;
}
i++;
}
}
}
========
end snippit
MTF-Frac.mq4

TradeWynds Aug 8, 2014 11:31am | Post# 9

This should get you started, but you are going to need something more. The Attached file is in Ea format, it will display 10 Fractals that coincide 4 hr downwards to 1 Min exact resolution. It could Identify, the zigzag you want to be looking at. Something I was thinking about
Thank you WhiteArrow. I'll play around with later today and get back to you.

TradeWynds Aug 8, 2014 2:44pm | Post# 10

The intention is to use zigzags as a pattern finder. At the moment my attention is on the relationship between H1 an M5.

From there I will look to see if there are any repeating patterns.

M1 would not use zigzags.

If the zigzag relationship is between D1 and H1, M5 and M1 would be used as filters and wouldn't use zigzags.

Each of these timeframes will use 2-3 very simple indicators with a protocol that would need to be met.

I've never found trading to be about indicators, but about the creative use of them.

whitearrow Aug 9, 2014 5:00am | Post# 11

1 Attachment(s)
Are we talking about self similarity . . or gartlys and stuff?

Click to Enlarge

Name: Image1.png
Size: 35 KB

TradeWynds Aug 9, 2014 8:07am | Post# 12

Are we talking about self similarity . . or gartlys and stuff? {image}
I've observed wolfe waves and harmonic patterns on different timeframes for many months. Now I'm narrowing
down the observation to only zigzags.

I'm looking at H1 zigzags in relation to M5 zigzags. Looking for a repeatable pattern on M5 once
an H1 zig or zag has formed.

whitearrow Aug 9, 2014 9:19am | Post# 13

ok . .keep us updated

TradeWynds Aug 9, 2014 9:58am | Post# 14

{quote} I've observed wolfe waves and harmonic patterns on different timeframes for many months. Now I'm narrowing down the observation to only zigzags. I'm looking at H1 zigzags in relation to M5 zigzags. Looking for a repeatable pattern on M5 once an H1 zig or zag has formed.
And if you have a pattern you think has possibilities, and want to share.

whitearrow Aug 9, 2014 10:42am | Post# 15

Not Really, just ghosts of things, more along lines of mandelbrot and selfsimilarity, exploring the possibility.

Mingary Aug 9, 2014 10:47am | Post# 16

Not Really, just ghosts of things, more along lines of mandelbrot and selfsimilarity, exploring the possibility.
Tried it.
Self similarity does not imply predictability

A zig zag on the 1 M can be the end of a zig zag on the 5 M can be the end of a zig zag on the 15 M ... all the way to weekly, but it does not mean that this is a reversal!

TradeWynds Aug 9, 2014 12:43pm | Post# 17

{quote} Tried it. Self similarity does not imply predictability A zig zag on the 1 M can be the end of a zig zag on the 5 M can be the end of a zig zag on the 15 M ... all the way to weekly, but it does not mean that this is a reversal!
If we look at the 8.8 EURUSD D1 candle/bar what do we see?

We are not using the zigzag indicator on D1 for this observation.

What if on the next trading day the EURUSD H1 zigzag indicator forms a 'zag' to the 'zig' that has formed?

Not really 'if' but 'when'.

Would it make sense to be prepared for a Buy entry when a 'zag' has formed?

Not using the zigzag indicator, because that lags too much.

But by some other indication(s).

Indications in the spirit of 'less is more' and that could be coded simply.

Always keeping in mind that we don't 'know' what's going to happen next.

But 'if' there is enough indication that the price is going to move in the direction of our trade at least to
a Break Even (BE) point, we would be relatively safe in entering a Buy in this example.

whitearrow Aug 10, 2014 2:05am | Post# 18

{quote} Tried it. Self similarity does not imply predictability A zig zag on the 1 M can be the end of a zig zag on the 5 M can be the end of a zig zag on the 15 M ... all the way to weekly, but it does not mean that this is a reversal!
Yup . . In hind sight it always looks so simple, but complex fractal patterns do occur and once you find them, as somebody once said:

" Its as if somebody has handed you a treasure map"

At present I mostly search for probable directions to keep my nerves steady

Having said that, there is a remarkable similarity between the 1 min and the 4 hour at the coinciding fractal in the pic above, whether its trad able or not is what I would love to figure out.

tdhowl Aug 12, 2014 5:18am | Post# 19

Hi TradeWynds,

I just started demo testing a zigzag EA with an interesting strategy. It trades on the minute 1 and makes high frequency trades. I'll try to explain the strategy.. As the zigzag indicator continues to repaint on the minute 1.. a certain amount of same lot size trades are open at different prices as the zigzag continues to repaint or move in the undesired direction. This is called averaging I think but I did not understand it until I now can see it in action. Win or lose as price moves back to the high of the next movement of the zigzags direction indicated.. all positions are closed. So this EA is averaging down while price is going against the desired direction, while maintaining high leverage open positions that will close out all together for high profit when price rebounds in the desired direction. So it seems to me the EA is compensating for repainting, while maintaining a lot of open trades to close out for a profit when price goes in favor of the open positions. This is best as I can explain averaging.

tdhowl Aug 12, 2014 5:49am | Post# 20

Hi, I would like to comment about my last post. My best guess is that this strategy will blow out an account in the long run because there is no limit to how far against the open positions will go. Even though the EA is attempting to compensate for repaint.. this I think in the long run would mean nothing, and the account it is used on would be wiped out. Here's a better idea.. an EA based on a non repainting indicator, averaging up in the direction of the trend.. instead of an EA based on a repainting indicator averaging down when price goes against.


© Forex Factory