Trading Silver with PSAR SUPERTREND EA plus ZigandZag & PSAR Oscillator Confirming - page 7

 

Tzuman, here are two test runs using ZAZZY 1.04, using Strategy 0 and then Strategy 1. Both are with no TS and TP.

One thing is clear: Strategy 0, Strategy 1 and v202a all give different results.

Ran them on the EURO 1H, as I could not get even marginal results on the 5M TF.

Let me know if you want me to run the 5M anyway and I will be happy to

do that.

Joe

 

Knew I was forgetting something:

For everyone following along, the ZAZ trend turning points for the period of Jan 28, 2011 through Feb 28, 2011 are as follows:

EURO 1H:

Jan 28 LONG

Feb 1 SHORT

Feb 7 LONG

Feb 10 SHORT

Feb 14 LONG

Feb 21 SHORT

Feb 22 LONG

(next signal is after Feb 28)

SILVER 1H:

Jan 28 LONG

Feb 22 SHORT

Feb 25 LONG

(next signal is after Feb 28)

JJ

 

Hello All,

I just got in and read your memos. I'll take a look at the orders in more detail and post another if there is anything interesting.

I am not surprised about the "errant" sell orders. The ZAZ lines change continually during the day, is it the dreaded "repainting". No, I think it is systemic. I am posting a screen shot I just took. Look at the lower left side of the chart and you will see an arrow. This morning, the ZAZ line went through it and then nearly vertical, matching the price increases until is stopped around the white side arrow. At that point there was a red sell arrow and the ZAZ line decreased slowly and then hit an inflection point and turned up with a green arrow about 19:15. When I just returned that zig and zag is gone and the ZAZ line now goes from the major swing low to the swing high. Even as I type this it is jumping around and may even eliminate the swing low on the lower left. What I believe is we look retrospectively and not prospectively. The "errant" sells were legitimate at the time but they were invalidated as the intermediate lows were taken out and replaced by higher highs, the ZAZ line straightened out so it was continually ascending and made it look like the sells were "errant", but were in fact correct at the time the order was placed Someone has a quote by Yogi Berra on this forum "predicting the past is hard, but predicting the future is really tough". I think it describes the ZAZ.

This is why I am very concerned about using the ZAZ and suggested we look at the next higher time period for confirmation. I am hoping it does not change direction as much although I am quite skeptical that is the case.

I am thinking along your lines that perhaps the SAR or a variant of it may be a good system. Recently its tracked the EURUSD quite well and there are some good runs on the H1 chart. I must warn you that it appears that there is a drawing bug in the SuperSAR. When you apply it to a chart or open its properties and then close them, it draws correctly. However, if left on a chart for an extended period, the new points are drawn incorrectly. I will address it tomorrow.

Files:
june27.gif  14 kb
 

To Tzuman:

Yesterday and today I am studying the EA action in the visual test mode, Jan 28 to Feb 28, using ZAZZY 1.04. For starters, I noted a failed reversal on Feb 1.

The SHORT Arrow & SAR triggered the reversal @ 1.3716 (at the close of the 9:00 bar). The Arrow disappeared at 11:00 and the SAR reversed to positive; it kept appearing and disappearing during the 14:00 to 15:00 hours, but the SAR was positive during that time.

Interestingly, changing the ZAZ 'keel over' input from 55 to 70 eliminates the false signal and replaces it with a white sideways arrow.

A new SHORT Arrow & negative SAR triggered the signal on Feb 2 and successfully indicated the new down trend. Am now particularly interested in watching whether the buy & sells between Feb 4 and 7 involved ZAZ signals repainting. Will watch it at 70.

Two thoughts come to mind at this time:

1. I'm wondering if, after the ZAZ & SAR trigger a trend reversal signal, incorporating a third confirmation signal is needed, such as the Supertrend. (Hope you found the bug you suspected, Bob.)

That way, in a failed reversal such as we saw on Feb 1 (at the 55 keel over setting), the buy positions would have gone on to garner additional pips (as it did), but if the reversal had been confirmed, it would have closed the open positions. Is this getting too many layers? Should we just be satisfied with a 70 to 80% accuracy rate?

It is clear the EA did NOT close the open BUY position when the trend signal was triggered. It finally closed when the T/P line (T/S ?) was hit. Should we be satisfied with this?

2. There is a 'no re-paint' ZigZag indicator, but it lags quite a bit. Don't know if this would be better than the re-painting, especially if we are using it to indicate major trend changes. I believe I got it from the TSD forum.

I've also attached a 'no-lag' ZigZag indicator from the Forex Strategies forum. Bob, if you look at the coding and see anything useful in either of these, I'll be happy to test them.

Have a GREAT day!!

Joe

 

Hello Joe,

First to answer one of your questions the strategy.

For Strategy 0, the current close has to be greater than SuperTrend and also greater than PSAR and the prior close has to be less than the prior SPAR and the current close has to be greater than ZAZ.

Strategy 1 is same as 0 but in addition, the PSAR oscillator has to cross the zero line. I think mathematically, that this condition is redundant as close1>PSAR1 and close2< SAR2 implies the same thing as a zero cross.

I'm attaching a shot that includes all three zig zags. ZAZ is in light blue, dotted line, ZIGZAG NRP is in yellow and NonLag ZIGZAG is in blue with wide line, M30 on left, H1 on right. What I found out is that with the proper settings you can make all these Zig Zags coincident. However, the NonLag is virtually worthless as it ceases to paint at the last major swing pivot, My concern is that prospectively, all Zig Zags "repaint" because the next swing high cannot be positively identified until several bars after it occurs.

I fixed some bugs in Zazzy relating to order placement and modification. Now it is looking better and can place two or more orders with Unique TPs as a multiple of the ATR. No new system yet.

Well, I hope you got the Barbeque Van completed so it can be used this weekend. And I hope the garage is air conditioned so you can use it. Its hot here, low 80's with a nice breeze off of the Nantucket Sound, Bright Blue & Beautiful. I'll lift one on the 4th to you!

Bob

Files:
july_1.gif  34 kb
july_1a.gif  42 kb
 

Quoting Tzuman: "Its hot here, low 80's with a nice breeze off of the Nantucket Sound, Bright Blue & Beautiful. I'll lift one on the 4th to you!"

You really know how to hurt a guy, Bob! Of course, a cold front moved through Phoenix on Sunday, so the temps dropped from 118 to just 110 for the 4th of July. Otherwise, it would have proved to be a really HOT holiday!! :-)

Wanted to thank you for the explanation of how the EAs actually are trading. Finally caught on that v202 was trading up to 10 positions at a time; this was why it was more profitable than v202a or ZAZZY. Between the two new versions you've created, v202a seems to trade a bit differently than ZAZZY and is more profitable. I've minimized the difference by setting both of them to trading max 1 lot, but their results are still not identical.

The other day I came across another ZigZag indicator, this one called the Gann Zig Zag, along with the Gann Hi Lo indicator. Like you, I've been frustrated with the repainting of most all of the Zig Zag indicators, though not enough to abandon use of them entirely.

After reading again how the EAs trading logic is set up, I tried something different: I took the Gann ZigZag (GZZ) on the MT4 Strategy Testor, using the 'CONTROL POINTS' model setting rather than the 'EVERY TICK' setting. Everything moves faster; earlier I'd verified that we were getting the same test results on the EAs, using either model setting.

I set up two GZZ indicators, one using a setting of 2 and the other set at 12. Then I set the Gann Hi Lo (GHL) indicator at 10 (These settings are somewhat arbitrary, something else may work better) and watched them perform. Of course, the EA wasn't using them to trade, so I couldn't look at their profitability.

What you'll see is that the GZZ 12 will remain at a high or low while the GZZ 2 goes up or down with the price action, then suddenly GZZ 12 will snap up or down to match GZZ 2. So, I'm wondering if your trading logic could be profitably and reliably applied to these indicators?

It would go something like this:

When GZZ 2 is BELOW GZZ 12, this provides a SHORT SETUP. When the GZZ 2 crosses BELOW the GHL line, this is a SELL TRIGGER. A sell order would be placed.

When GZZ 2 is ABOVE GZZ 12, this provides a LONG SETUP. When the GZZ 2 crosses ABOVE the GHL line, this is a BUY TRIGGER. A buy order would be placed.

Haven't figured out yet whether open positions should be closed when GZZ 2 and 12 meet or when GZZ 2 crosses the GHL line. What appeals to me is that there seems to be minimal ambiguity as to where things stand and when signals are generated. Couldn't spot any repainting on GZZ 12.

Anyway, I was back to testing SILVER, since that is my trading vehicle of preference. The optimized setting for ZAZZY are as follows for Jan 1 to Jan 20 1H SILVER:

PSAR STEP: 0.045

PSAR MAX: 0.25

Trailing Profit: 35

Trailing Stop: 95

Turtle Stop: false

ATR Stop: true

Everything else remains at default settings.

I'm running the tests on a TDFX demo account using a $1,000 opening balance.

Attached is a screen shot of what I was describing and the relevant indicators. (Not 100% sure about the Hi Lo)

Enjoy the holiday and let me know what you think of the above when you get back, Bob!!

Joe

 

Zig Zags

Hello Joe,

Another BBBB, dry in the upper 70's.

I have not had much time to devote to trading this week. I'm replacing a shower wall and had to use the old tiles, nothing matches. Its amazing, I'm using my father's chisels, Stanleys made in the USA and the tiles are stamped made in the USA. Shows you how old they are.

I think you have some good observations on the Zig Zags and next week, I will examine your strategies. I found several and tested them and generally, if you fiddle with their settings, you can get all of them to plot identical lines. I also found an EA based on ZigZags and will look at it to see if it provides any eureka insights.

In my ZigZag searches, I found a Fib drawer that comes very close to Zig And Zag for period =55, see the screen shot. The fib is in yellow and has the Waves marked X,A,B,C,D and the fib levels plotted. The shot only shows CD but you can also show AB & BC.

I have gotten interested in SAR and have two versions, SAR & Parabolic Best on the shot. SAR is the solid green/red line and the Parabolic Best is the Green/Red dots above or below the SAR. The horizontal dots are resistance support levels. What is interesting me is that they both provide a much longer time in the market and hopefully more pips, especially when the reversal occurs just after a major Zig Zag high or low. I'd like to incorporate them into Zazzy as a SL value to see if we can improve efficiency with better stops. The Fib levels interest me as potential TPs for multiple orders. The SAR and Parabolic Best calculate the parabolics directly instead of using the Metatrader built in function iSAR. This means we will have some flexibility to modify the calculations to meet our objectives.

Tzuman

Files:
july_9.gif  31 kb
 

To Tzuman:

Tearing out and re-tiling a shower? You are a BRAVE man, Bob! :-)

Actually, years ago I did flooring, both new construction and remodeling. The remodeling was the most work, but also the most satisfying when you were finally able to stand back and view the completed job. Take your time and have fun!!

BTW: Whats a BBBB? (Beneficent Bayside...? Beautiful Blonde Babes...? Bountiful Boston Baked Beans??) (OK, I know it has something to do with weather, but exactly what escapes me. Have mercy!!)

JJ

I spent some time studying the chart you posted. Interesting how the S&R seem to closely match up with the Fib lines, eh? During ranging markets, both the SAR and the Parabolic Best look like they will lose some money, but they both do well during trends. Looks like the P/B stays in longer than the SAR.

What I really like is the ABC waves of your Fib indicator. Are there any delays in their appearance or re-painting issues? Can you actually use them to identify market turns for the EA?

If you could post it, I'd like to play with it. In turn, I've attached a ZigZag with Fib that you may find interesting, though at first glance I think I like your Fib indicator better.

Of course, I'm particularly interested in your opinion regarding the ZigZag/Gann. If it's not too hard, can you create a Zazzy-G? If so, I'll optimize it for the EURO and SILVER and see how it performs.

Any others you create and would like me to test out, I'll do the same so we can have a clear comparison between them all.

Meanwhile, enjoy the remodeling!!

Joe

Files:
 

Hello JJ,

I got carried away with the B key.

I downloaded your Zig Zag with Fibos and compared it to mine. I think they are both essentially the same. Someone started with Zig Zag code and probably added the fibo lines. if you set all to 55 you will find that the major difference is yours identifies the Fibos from top down, point C to point D and mine orders them from bottom up, point D to point C. There is a difference in the 23.6 and the 78.3 line. I think that this indicates a bug in one or the other in calculating the value of each fib level as they probably should not be coincident going in opposite directions, e.g. CD or DC. I'll check it out and let you know. I'm attaching the indicators you are missing and the template so you can recreate my screen shot.

This week I am going to make the Signal Generator a callable function from the Libraries so both EAs can use the same code. I'll update it with additional strategies for your Gann suggestion as well as using either ZAZ or the Fib versions.

Zig Zags and Fractals are by definition repainting since you cannot determine if you have reached an interim high or a turning point high where the Zig Zag point will occur until after it has pased. You can only determine this after a number of future bars to enable you to look back and make your determination. Even then, a higher high may occur and invalidate your current candidate. Look at the BC line on my screen shot. As you travel from B to C, within 55 bars, see how many minor swing highs there are. I count 9, so potentially the Zig slope changed 9 times. In addition, I am not knowledgeable about when it decides to create a Zag point so potentially we may have had a few Zags that were "taken out" by the continued higher highs.

One thing I have noticed about the SAR, Parabolic Best and ZAZ is that SAR looks good for a stop loss, ZAZ provides a lot of indication arrows, red white green, during a lengthly ZigZag. Retrospectively, it seems that taking only additional orders in the Best direction may be profitable. Remember Strategy 2 of Zazzy when I tried this and failed miserably? Perhaps this is the solution, using Best as a confirming filter. My goal is to make SuperSAR which combines the two and also the SuperTrend. This is quite a ways off yet.

Have a good week, I'll upload improvements as they are ready.

Bob

Additional Information on Fib lines

In Zig Zag Fibo, there is a coding error where the xy coordinates of the rectangle should be reversed for a ZAG so that the zero Fib line is at the "D" level, not the "C" level. The fib lines starting at 0.236 through 0.618 (there is no natural .786 fib line) are drawn by a metatrader function. In Fib Generator, the lines are calculated and then drawn by the program and an artificial 0.786 was created, no idea on how this decimal was picked. Correcting the Zig Zag Fibo to start at the "D" level draws coincident lines for both indicators so my assumption about the calculation error was wrong. I have not tested the Fib Generator for an ending Zig nor made changes to insure Zig Zag Fibo works correctly for both Zigs and Zags.

Files:
 

RE Post 66

Hello JJ,

Its BBBB today, Bright, Blue, Beautiful & Breezy. Cold front with Tstorms came through last night,. This AM its 58, yes FIFTY EIGHT.

Anyway, I have been reading and re reading your post 66 and have installed about a dozen variants on the ZigZag. Nearly all can be set so that the Zigs and Zags are coincident. The non repainting ones seem to stop at the last high and wait multiple bars before determining if the reversal occurred. Your suggestion on 66 seems good however I am still highly concerned that the calculations of the ZigZag cause 2 problems. First with the GannZZ, it appears that it does not immediately draw the last line for several bars. Your screen shot and two I took this morning seem to confirm it. Notice after the last leg up, there is no continuation of the ZZ line. If this is true then we will miss most of the gains that occur at the beginning of a reversal. My other concern still remains that the turning points of the ZigZags are retrospective. They are only determined several bars after they occur. This causes repainting as in the future a "higher high" may cause the line to change its slope. And with that, previous signals may be come invalidated or vice versa, they may be missed. Most importantly, I believe we will miss the first and probably best signal that occurs just after the ZZ line reverses.

Now, having said all this, I will incorporate two variants of the Gann strategy into the EAs. The first will be your suggestion,

Buy: GannZZ2 crosses from below to above the GannHL and GannZZ2 is greater than GannZZ12

Sell: GannZZ2 crosses from above to below the GannHL and GannZZ2 is less than GannZZ12

Variant 2 will add the filter that the GannZZ12 slope must be ascending for Buys and decreasing for Sells.

The inputs for all three indicators will be variables allowing us to test other settings.

I looked at the code and all comments are in Russian. In addition, I'm not sure just how the Zig Zag Lines are being drawn. Some only calculate only the two end points which means that the intermediate values must be calculated on the fly to enable bar by bar evaluations.

If things go well, I plan to give you the new system this Sunday.

I think if we determine that we can use Zig Zags, we should settle on one as our standard and then I can incorporate the best of the others into it, like naming the turning points, ABCD and incorporating Fib lines off of the last turning point. Right now I am leaning towards Zig and Zag, but its code is difficult to understand.

Tzuman

Files:
july_14b.gif  28 kb
july_14.gif  24 kb