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

 

To Tzuman:

Looks like you've put in a lot of hard work. I concur with your observations; over the past months I've compared a lot of indicators, including zig zags, and found the Zig and Zag one of the most attractive. Also like the SAR Oscillator; not because it's better than the others, but because it's easier for me to read the crossovers. :-)

As to the Gann Zig Zag, it does exactly as you described: selects a high or low until a higher high or lower low comes along. Combining a short term zigzag with a long term zigzag, I noticed that the long term one didn't seem to do that, but did take a long time to come up to the current prices. By comparing the short and long term zigzag VALUES, it seemed to me that the shortcomings of each indicator became less relevant.

Also, I ran the Gann Zig Zag with an input setting of 1 and it follows each bar fairly closely. Don't know if that helps the EA trade or not, but it can be done.

Running the Strategy Tester using the control points model (instead of the every tick model), putting the Gann ZigZag on twice (one input at 2, the other at 12), and triggering positions with the Gann Hi/Lo activator, it SEEMED to give good signals without giving up too much profit.

Notice I say SEEMED. Set up that way, everything on the chart moves at warp speed, which can be misleading. While it looks good, I'll reserve final judgment until we can actually see what the EA does with the indicators.

Studying the screen shots, I see what you mean about the lag; the GannZZ-2 has not made the final move to stay current with pricing. Most trend following systems assume you will catch about a third to a half of the overall trend and that is considered successful. Even if we give up a bit to confirm a trend, we should do a LOT better than that!

Also, on the right edge of the chart, a SELL has already been triggered and the POSITION is still making profits, even though the Gann ZZ-2 is lagging. One way to squeeze more profitability out of the signals is to trigger the "close all open positions' and then open positions in the opposite direction when the Gann ZZ-12 and the Gann ZZ-2 are equal in value. The Gann ZZ-12 lags a LONG TIME, which allows for a lot of market movement.

The price of such a strategy would likely be increased false reversals, but that might be a price worth paying if losses are cut short. Testing is the best way to answer that too, eh?

As to Variant 2, you said:

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

Perhaps I'm visualizing that incorrectly, but wouldn't the Gann ZZ-12 slope need to be touching a low (thus DESCENDING) with the Gann ZZ-2 higher for BUYS and touching a high (thus ASCENDING) for SELLS? I may be wrong about that.

Bob, I look forward to putting the new Gann EAs through their paces on both the SILVER and the EURO. Lots to learn here and what we learn should prove profitable!

As I'm sipping on a tall cool one in the 109 degree shade (with 50+ percent humidity from the summer Monsoons) this Saturday, I'll be thinking of you!!

Joe

 

Gann ZigZag & High Low

Hello JJ,

I've put the code in the EAs to call the two Gann Zig Zags and also the High Low. MY fears were realized regarding the ZigZags; they are drawn as a ray between the high and low points; everything in between is zero. This means that I either have to interpolate to get the intermediate values to calculate cross overs or use the end points of the ZigZag.

I have been studying the attached charts for a couple of hours, from right after the lowest low on the right. What I found was the major Zig did not occur until the price reached 1.4048(high). So the last non Zero value of the Major ZigZag was 1.40172 or its lowest. We would issue a buy when the Minor Zig passes through the High low indicator at 15:00 at around 1.40230 and there would have been a nice run until 15:36 at around 1.40430 for about a 20 pip gain. However after that, the Major ZAG ends at 15:30 at 1.4048 and the minor ZigZag is always below it, signifying a sell condition, at 15:36 & 15:43 which would evaporate our good gain. After the break up at 16:10 the Major Zig continued to be redrawn upwards with a decreasing slope from the major low

The chart is M1 and the major GannZZ is 9 and the PSAR increment is 0.01. The values in the Experts window "Gann " are the HiLow value, the FastZZ(2) value and the slow ZZ(9) value.

Right now, I'm not optimistic about this strategy due to delayed calculation of the last leg of the major ZZ. I'll make up a system release later tonight on what I have done so far. Trying to incorporate these decision rules into the EAs will be a complicated and lengthly task that I want to make certain has a potentially good payback. I'd like to suggest that you spend some time watching live price action to make your own evaluation. I will make a test system for you later this afternoon and post it this evening. By the way, the Gann Zig Zag produces an output test file that can get quite large if you let it run overnight. The new system will eliminate it.

Bob

Files:
july_18.gif  65 kb
july_18a..gif  67 kb
july_18b..gif  67 kb
 

Version 106

Hello JJ,

Attached is version 106 that includes the Gann ZigZag enhancements. Strategy option 3 only displays the Gann data in the experts tab. It does not make any buy/sell decisions. Both EAs are using the same strategy code now.

Files:
zazzy_v1.06.zip  175 kb
 

To Tzuman:

After running the Zazzy v1.06 (Zazzy-G) through it's paces, here are my observations, not necessarily in the order of importance. I'll also include clarifications for those following our progress.

1. First, I ran the Strategy Tester using the 'tick-by-tick' mode and then the 'control points' mode to verify that v1.06 still uses end of bar data and obtains the same results using either method.

Thereafter I ran all tests using 'control points' as it is MUCH faster and allowed me to run many more variations in the given hours available to me.

2. At the end of the test, I noted that several indicators in addition to the Gann Hi/Lo and ZigZag are attached to the EA. (See attachment #1)

Bob, are we sure that the EA is not reading any of them (ATR, PSAR, SAR-Osc)?

3. Testing the EURO, the best results for the period of Jan 1 through Jan 31, 2011 was $742.67 using the H4 time frame (TF), followed by $591.99 using the H1 TF and finally the M15 with $105.92 profit, though I had to use the 'REVERSE SIGNAL_true' setting on the latter. Could not obtain a profit on shorter TFs. This same pattern showed up testing SILVER. Haven't tried Daily TF yet.

4. Strategy 0 and Strategy 1 produce identical results and better results than Strategy 2.

ATR stop produces larger profits than Turtle stop.

Settings used for EURO are as follows (as taken from the test report header):

PSAR.Step=0.015; PSAR.Maximum=0.25; TrendCCIPeriod=14; ZAZ.ActivePeriods=5; OrderStrategy=1; Gann.HiLow=9; Gann.SlowRange=9; Gann.FastRange=2; ZAZ.SlowKeelOver=55; ZAZ.SlowSlalom=17; ZAZ.FastKeelOver=55; ZAZ.FastSlalom=17; ReverseSignals=false; S_MoneyManagement="*** Money Management ***"; Lots=0.1; DynamicLotSize=false; RiskMM=false; EquityRiskPerCent=1; NumberofEAs=1; S_OrderManagement="*** Order Management ***"; TakeProfit=0; TrailingProfit=0; UsePendingOrders=false; PlaceBracketOrders=false; MaxOpenOrders=1; DynamicTakeProfit=0; TakeProfitsAt="1.0,2.0,3.0"; UseTPsForSL=false; Slippage=3; MagicNumber=1961132650; S_Exit1="*** Order Exit Options ***"; TrailingStop=0; TrailingStep=0; BreakEven=0; BreakEvenPipsinProfit=0; ProfitRetention=0; TurtleStop=false; LookBackPeriod=5; ATRStop=true; ATRPeriod=55; ATRValue=2; ATRFileName="ATR"; MovingAverageStopLoss=false; MARPrice=6; MARMethod=8; MARPeriod=25; S_TradingTimes="*** Trading Times ***"; TradeHourStart=0; TradeHourStop=24; TradeSignalEveryTick=false; TradeSignalEveryBar=true; TradeSignalByMinutes=false;

5. The EA automatically placed a trailing stop (TS) on opening a position. It looked to be about 10 pips on the M1 chart, even though nothing was indicated in the Trailing Stop input. It looked like a lot of trades were closed out prematurely, just before price moved into profits; I'd tried to set a larger stop (at 20 instead of 10), but the EA ignored my efforts. Can we change that? The 'Optimizing' feature didn't seem to work either.

6. If you look at the second attachment, where I stripped out the extra indicators, you'll see two yellow vertical lines, indicating where I expected BUY and SELL positions to be opened after crossing the Gann HI/LO line. Didn't actually see the zigzag action at the BUY position, but watched at other times and saw the same thing; not an issue of re-painting the zigzags. At other times it seemed to work with the Gann HI/LO trigger rather well.

7. For the short term zigzag I changed the input from 2 to 1 and this reduced the lag time for the fast zigzag. Does this help, Bob?

8. All in all, I give our new 'child' a B+. Trades better than most people do, though she likes the longer time frames better than the shorter ones. :-)

She should be dynamite once the Money Management feature allows the trade positions to grow with the account size.

Still, I think we'll learn a lot more by tackling the remaining challenges of the M1, etc. One thing I noticed is a pronounced "punctuated equilibrium" in the price action that is not as strong in the longer timeframes. That may account for the deterioration in the test results.

Bob, if you can address the issues in #2, #5 and #6, that would give us the greatest improvements, don't you think? Let me know if you have any questions or if I've missed anything!

Meanwhile, make it a GREAT day!!

Joe

 

Zazzy v1.06

Hello Joe,

How are the sandstorms? CC got up to 98, mild for you but extreme for me. This am it was 63, suffer!

Anyway, here is what I can respond to your last post.

The latter 3 indicators are called at the start of the Signal Generator, no matter which strategy we are using. This is lazy coding on my part as only strategies 0,1,2 use them; strategy 3 does not. Likewise, the ATR is getting called universally but only used if the ATR exit strategy is true.

I am puzzled by the indicators on the chart. The programming help file indicates there is a function to enable the EA to display or not display the indicators. Every time I have tried to get the display it has failed. Perhaps this display function only works in the back testing mode.

In your parameter specification list, the ATRStop was true. This will call out the calculation for an ATR stop which will be immediately entered by an OrderModify call. I have set all stops to false or zero and tested and found Zazzy will not place any default stops. I have modified the attached version to set all variables to the values you specified.

Please repeat test #5 with this new version to see if that default 10 still shows up.

I think changing the short zigzag to 1 will essentially force it to follow every tick up or down. It may help. By the way, in your defaults, you have set both ZAZs to a 55 period. I have also found some other Gann Hi Low indicators that I will be testing shortly.

I am not surprised that you have found profitability decreases with time. Many of the other threads also use either H1, H4 or D1, rarely do they use lower time frames. Interestingly using my stand alone system, it seemed that the lower time frames did better as they tracked ups and downs whereas the higher time frames did not catch the small reversals.

I will be implementing the Gann HiLow Strategy 3 this week for us. When done, I will incorporate any other suggestions/fixes you find and release the next version

Good Trading

Bob

Files:
 

Post 67 Gann ZigZag

Hello Joe,

Can you confirm if this screenshot meets your conditions for a Gann HiLow ZZ buy? The Major ZZ low occurred at 14:50 and there is no ray drawn since. The Minor ZZ Passed through the HiLow during the Bar at 15:00 so we would either have placed a buy at 1.43481 at 15:05 or a pending that should have been scaled down to around 1.43445.

I think it does. So I will try to incorporate the code necessary to generate a buy signal based on the inflection point of the major ZZ being less than the current zz end point.

Files:
july_25.gif  33 kb
 

Just a quick response to your questions, Bob, then on to more testing:

1. YES!! The buy signal would come exactly where you described it!!!! :-)

2. The attachment showing all of the indicators was taken right after a back test (Using MT4 Strategy Tester). They do NOT show up during the test run, but only after completion.

3. Using the ATR stop produced the best returns, but I'd like to test it using Strategy 3 against the other stops (Turtle & MA), plus without any of them.

4. I've always understood that markets were largely fractal, meaning that short-term TF signals would look nearly identical to long term TFs. Thus, without a TF scale to measure by we would be hard pressed to differentiate an M5 chart from a Monthly chart.

Looking at the 'stripped' attachment on posting #75 (M1) would seem to bear this out. The zigzags met at the low, then separated, price clearly crossing the HI/LO line and going on to a nice (profitable) move.

I'll run that again on the next version. I'm optimistic as to what the results will be.

5. My hope is that on Strategy 3 you will figure out some way to close all open positions a.) when the long term & short term ZZs meet; or b.) immediately prior to opening the new positions in the opposite direction.

6. The 55 input on the ZZs is the default setting. Tried to do an optimization run and came up with no valid differences. I got lazy and ran the comparisons using the defaults.

Will go back to one of the earlier versions to run optimizations and will let you know the results from that. Earlier, I'd found 70 to be a better setting, at least on the longer term TFs.

By the way: This morning it was 86 degrees and 58% humidity! High should be about 103, but that is the price we pay for gorgeous winter weather.

OK! Back to testing!! :-)

JJ

 

Bob: With regard to the trailing stop, I ran a test on July 18, 2011 to see what the TS was now doing.

Used the EURO M1, just like before. This time I went to the RESULTS tab in the strategy tester; the TS ranged from a low of 7 to a high of 24. My guess is that it is using the ATR for a volatility based stop; am I right?

Anyway, I changed the ATR input to 4 instead of 2 and that increased the TS spread. Now, if I can use the Trailing Profit to lock in pips before a retracement, that should give some interesting results.

Can you explain how to use those features?

Thanks Bob!!

Joe

 

Zazzy Trailing Stop

Hi Joe,

I am going to have to check on the trailing stop in detail. It should be a fixed amount, 10 pips for example. If it is variable, it was not my intention. If it is changing, then did you have ATR stop = true? Your prior example had it. In this case, it is a dynamic stop, based on the current ATR value. If this value is increasing due to volatility, then the stop value will increase.

I started this message yesterday and lost it all. I am posting 3 screen shots, 25a, 25b & 25c. They are M1 and taken about 10-15 minutes apart, In a, the fast zz drops below the HiLow and the slow zz is above so this is a legitimate sell at this point. Then the fast zz reverses and crosses above the HiLow which is not a valid buy as the last slow zz is still above. In B the slow zz moved to a higher high and the fast zz crossed the HiLow down indicating another legitimate sell. In C, the slow zz has moved to yet another higher high but no sell given. What I would like you to think about is how we handle this situation which I think may be common. In C, you can see 7 higher highs from the time the slow zz made its major low. It seems to me that we would have made one profitable buy followed by 6 sells that would have been unprofitable. Note the volatility meter at the bottom, the red bars are the do not trade zones.

I am also attaching another three charts from today that show similar characteristics.

So think about our strategy for buys and sells and how to close them out. I am doing the same and I am also implementing a buy/sell strategy so we can see in detail how Zazzy will place orders.

Tzuman

PS, Read the attachments from the bottom up

Files:
july_25a.gif  25 kb
july_25b.gif  23 kb
july_25c.gif  22 kb
july_26.gif  30 kb
july_26a.gif  29 kb
 

To Tzuman:

Bob, after studying the screen prints you posted, I spent the afternoon and half of this evening running backtests on the July 25 & 26 period. Watching it walk through the steps showed me exactly what you described.

First I ran it with the settings at 9 and 1 for the slow & fast Gann ZigZags, respectively. Lots of false signals and losing positions.

After numerous runs, I slowed everything down. Changed the ZZs to 14 and 2; changed the Hi/Lo Indicator from 10 to 14.

This gave the price action more time to create a top/bottom and eliminated many of the instances where the slow ZZ kept moving higher (or lower) after triggering a buy/sell order in the opposite direction (hence the losses). Don't know yet if these settings will work with all TFs or just M1.

Same with the fast ZZ, though I must say using 2 instead of 1 was counter-intuitive for me. It lets price 'wander' a bit before catching up, which eliminated some (not all) of the reversals.

HI/LO line was further away from price as well, so again, many of the reversals were avoided.

Finally, I looked at strategy:

To begin with, the HI/LO can be IGNORED after it triggers the CLOSE of previous positions and OPENS the positions in the new direction -- until the SLOW ZZ makes its next move.

For those remaining instances where the SLOW ZZ moves, then changes to a higher high/lower low and again the HI/LO line is crossed, I think we should look at opening a second (or even third) position in the indicated direction.

Of course, a more conservative option would be to close out the position for a small loss and open a new position when the HI/LO line is again crossed. This might result in two or three small losses, but as long as we have substantial gains on the winning positions, all is well. :-)

If we can activate the 'OPTIMIZATION' feature in MT4, we can see what sort of stop loss would balance safety against gain. Otherwise, a wide S/L should protect against catastrophic losses while still allowing the EA to maximize profits.

Other things I'd like to explore:

1. Whether using a Trailing Profit could keep us from giving back so many pips.

2. Whether the Damiani indicator keeping the EA out of the market at times would improve returns. (I like that indicator; where can I get it?)

3. Whether your idea of multiple positions with differing Take Profit points would improve the risk/return.

4. Finally, would profitablility be improved if open positions were closed when the SLOW ZZ first caught up to the FAST ZZ, especially using the 14 (or even longer) setting, rather than when the HI/LO line was crossed?

So how close are we in our observations & conclusions?

Let me know what you think.

If I don't hear from you sooner, make it a GREAT weekend!!

Joe