I am attaching version 203 which just has cosmetic changes from Leeb's version as well as a screen shot from today with EURUSD M5. I have seen too much repainting of the indicators, e.g. Buy/Sell arrows move or disappear. This makes me very skeptical about the accuracy of an EA.
I for one, not only DON'T mind, but I WELCOME your participation and contribution in building an EA that can prove profitable for all of us. Same for anyone else who can provide constructive input.
Now to answer the rest of your questions:
1. No reason NOT to test it on the EURUSD. In fact, a truly robust EA or system should work on almost any chart. The inputs would need to be adjusted to the nature of that market, but then that is true over time in the same investment, be it silver, the Euro or anything else.
2. My personal preference is to use the 1H time frame, but once the EA is accurately reading the market directional signals, I can see no reason why it couldn't work in almost any timeframe. You might need to tweak the Supertrend indicator settings in order to get it to place a trade in that short TF.
3. Using the longer TF reduces the impact of the ZAZ repainting and YES, the trade is placed upon confirmation by the SAR Oscillator.
4. The intent of using the ZAZ arrows is to provide a LONG, SLOW indicator of market direction and then allow the Supertrend EA to trade within that direction.
Thus, the FIRST blue arrow in the left 1/3 of the chart (I can only see the one) would be a setup signal for a long-only strategy, with the SAR Osc crossover as the trigger signal. Any short positions would be CLOSED at that time. The EA would open any new long positions based on the Supertrend indicator.
The FIRST red arrow in the left 1/3rd of your chart would be your setup signal for a short only strategy, with the SAR Osc crossover as your trigger. Any long positions would be CLOSED at that time. The EA would open any new short positions based on the Supertrend indicator.
For now, the subsequent red arrows would be ignored. Trying to trade them might work, but increases the complexity of the system. I'm hoping we can get the EA to pick up the FIRST red or blue arrow signal; that should prove satisfyingly profitable.
Going back to your chart, on the hard right edge, it looks like price action is about to reverse itself. If it does, then a blue arrow would signal a setup and on confirmation by the SAR Osc we would CLOSE all short positions and let the EA trade as it will, but LONG ONLY. If the price action continued down, we would allow the EA to either maintain or close the trade as the Supertrend indicator tells it to.
By the way, I ran the EURUSD on strategy tester (uptrend, long only) using the alpha settings. By alpha, I mean with default settings. The reason I do it this way rather than optimizing is to allow us all to see what effect the ZAZ and SAR OSC have by themselves. Optimizing and then re-optimizing periodically should only make returns better, but that will come after we've worked the bugs out of this system.
I ran it using the 1h TF since you have directional changes INTRADAY at the 5m TF. Don't know how strategy tester would handle that. Anyway, the EURUSD works!
Hope that provides the clarification you were looking for!!
Hi again, Tzuman:
Ran the leebmod EA and the v203 you so kindly provided , comparing the results to the v202 test report attached earlier.
Neither the leebmod nor the v203 took any trades. The v202 took one trade. Using the default 14 period it managed a 35 dollar profit. The report above showed a 300 dollar profit, but using a 45 period setting. I forgot to mention that earlier.
In each case, I traded from May 23, 2011 to June 7, 2011, long only.
I am not surprised that 203 did not take any trades if the Leeb version did not as they are almost identical. One change between them is that the Entry values for SAR Step and Maximum are hard coded at 0.02 & 0.2 in the internal calls to the SAR Oscillator even though they are listed as input variables. I made a change to use the input values instead of the hard coded ones.
In addition to back testing, you should set up a forward test (4 digit non ECN broker) on a demo account and watch the action of the ZAZ indicator as ticks come in. Use EURUSD on a M5 chart and zoom out until you can see the start of trading for June 14th. You should see a sell arrow appear and disappear right at the start of the trading day of 6/14, see my previous attachments. I am attaching another screen shot for you. If you watch the screen long enough, you will see the buy sell arrows moving to adjacent bars and disappearing and re appearing. This is the repainting issue that makes me conclude that the ZAZ is useless for an EA; You would get too many false positives that will become losers. Also look as the last several bars between the June 15 & June 15 (2) shots and see how the buy indicator in the first shot disappeared in the second one.
Your points are well taken. Appreciate the screen shots too. The repainting issue is one that has stymied many efforts to solve.
Here are my thoughts on why it can be made to work with an EA:
Looking at the ZAZ indicator edit window/color tab we see the indicator's signal options numbered zero to six.
What the EA would be looking for is not a signal per se, but a CHANGE from #5 to #6 or the other way around.
For our purposes, the 'arrow' could be one continuous signal until the CHANGE was noted.
If the arrow appears & disappears within a single bar is not relevant. It only becomes relevant at the close of the bar it first appears in. The actual trigger would be when the SAR Oscillator confirmed the change.
Note the screen print below; the blue & red vertical lines marking where the actual direction change would be triggered. (Don't know why the screen drops a day there)
Many indicators are unreliable in shorter timeframes; that will probably prove true of the ZAZ indicator as well. That is why I prefer the 1H TF; it gives the signal more time to stabilize by the end of the bar. If you trade the 5M TF you could still have the directional change made based on the longer TF.
The PROOF OF CONCEPT as to whether it works (or not) can only be validated by coding accordingly and running the EA on various investments (I still prefer silver and you prefer EURUSD, so that gives two to test on).
Question is, do we have anyone with the skill AND the willingness to help us do the necessary coding? It may be more complex than I realize. Seems to me the risk/reward ratio justifies our asking; do you agree?
New EA: ZAZ PSAR v100
I have been working on incorporating my subroutines into the original EA and have found that there is basically nothing left of the original EA except the signal generation logic which I believe will also be drastically modified. Thus, I am proposing a new EA: ZAR PSAR.
My first objective is to get the system working so we can use it with either 4 or 5 digit brokers and ECN or non ECN processing. Right now I have a system that syntaxes correctly but is missing some of the calculations for 4&5 digit quotes and money management which I will do tomorrow and test it for a day and release it to you for further basic testing, probably over the weekend. Once this is achieved, then we should first focus on buy/sell logic then on maximizing profitability by identifying and preventing trades during choppy non trending periods and then finally incorporate some of the auxiliary logic that is included in my functions like pending orders, bracket orders and multiple orders with distinct TPs.
I am still unclear where the SuperTrend indicator comes into the signal generation process. It seems to me that we are looking for a ZAZ arrow either at the bottom or top of the ZigZag line as a preliminary signal and the PSAR oscillator passing through the zero line some number of periods after the ZAZ arrow. After I start testing, I will get into the logic to better understand it but if you have an explanation, it would be very helpful.
Two things changed my mind from negative to positive. One was a general agreement with you on the repainting issue and looking only at the end of the bar. I think that we should know in a week or two if the repainting issue causes an insurmountable problem. I am thinking about refining it further and incorporating a minimum and maximum bar spread for the ZAZ arrows and also using a highest and lowest algorithm to try to prevent false positives where the arrow is posted at the bar end due to a small swing change in price direction but then the price reverses again and the original zig zag low is taken out along with the arrow. I think what we want to see is the arrow occuring one or two bars after the ZAZ reverses direction, not at the absolute bottom. The maximum bar spread would be used to determine the amount of time the arrow signal remains in effect. The other thing is that if you reduce the value of the PSAR step to 0.010 or 0.015, the resulting PSAR tracks quite well with the ZAZ and perhaps can be used as a close signal. Put a SAR on the chart and change the step and let me know what you think. Basically, the SAR is the same as your SAR oscillator but on the price chart, see the little dots on my chart postings.
Don't worry about coding skill level; I have it as I was a software developer for many years. I may not be in Mladen's class but I have enough experience to do this and I agree that the risk reward may justify spending time exploring your trading strategy. Time will tell.
I've tried the PSAR SUPERTREND EA V203 in EURUSD M5, I can say that results lor were optimal, I liked a lot. the Backtestings have been very good, you do not schedule EAs, but I like to test with any
Forgive me for my bad english
Thanks to all of you.
I have made much faster progress on developing the new EA, ZAZZY. Right now, it is placing orders with Stop Loss and Take Profit and is using the old rules or I am forcing it to issue a sell order on each bar to test its logic, so ignore any references to the account equity.
Over this morning while developing the EA, I have taken several screen shots. Please start your analysis at around 9:45 this morning where you will see a ZigZag reversal and a Green Buy Arrow. Notice that the recent down trend at 11:45 has almost straightened out the recent zag. If it had, I'm quite certain that the 9:45 buy would have been eliminated. #2 shows a reversal of the 11:45 down trend and the addition of a second Green Buy. #2a shows a downtrend zag and a red sell at 12:45. #3 shows the original zag as positive and the elimination of the red sell. #5 shows a downward zag and another red buy at 16:45.
While I realize that the rules require confirmation of the potential order by the PSAR, we have two issues to settle.
Do we need to establish a bar limit for the PSAR oscillator to confirm the order; right now the currency is 6 bars away from the red arrow and the PSAR is still positive.
Assuming we received confirmation and placed a sell order, how do we handle a reversal that changes the zag slope back to positive and eliminates our current sell arrow?
I will be spending some time later this evening and tomorrow, trying to improve the signal generation process and developing a coherent structure for a zip file to disseminate the software to you.
Let me start by saying "WOW", then "THANKS" and finally "WOW" again!!
As you may well realize, some of what you said I can follow and some is over my head. However, one of the parts I do follow is your question about how many bars we should allow before a signal becomes invalid. In the beta version, perhaps we can test different number of bars to see what effect it has during a ranging period.
A similar question needs to be answered with regards what TF works best. While I'm partial to the 1H TF and trading the same TF, that doesn't mean that trading the 5M or other TF wouldn't be better served with a different ZAZ & SAR time frame. That is something I can take on.
Let me now approach your question about the Supertrend indicator.
This is what Senior Member Jason Rogers said in another TSD thread discussing the Supertrend indicator:
01-12-2011, 12:23 PM
Supertrend indicator is based around average true range. Green indicates a bullish trend and red indicates a bearish trend. The indicator parameters let you set the atr length and multiplier.
Attached Thumbnails Attached Files SuperTrend.zip (1.6 KB, 292 views)
Mentally I segregate the ZAZ and SAR Oscillator from the Supertrend indicator. The first two tell the EA when to trade LONG or SHORT; nothing more.
Supertrend tells the EA when to BUY and SELL and when to do nothing at all. Seemed to handle choppy markets fairly well and never I had a problem with the CPU getting overloaded, so I stand encouraged.
Playing around with the inputs, I've found like you that changing the PSAR values can improve results. On silver the best settings were actually 0.06/max 0.6. Also, I got better outcomes by using a 45 day period on both the EA and Supertrend.
Don't know if that will hold true in the future or for currencies. Of course, I match the period settings in both the indicator and the EA. I use Strategy Tester to optimize; probably something worth doing on a regular basis, eh?
NOW TO THE SCREEN SHOTS:
#1 At the far left we see a LONG setup, with the SAR OSC confirming one or two bars later. That leaves the EA free to buy or not, based on the Supertrend (average true range) indicator.
Next arrow is a SHORT setup, but there is no confirmation, neither then nor at the second SHORT setup arrow. The SAR OSC finally gave the trigger signal shortly before the price action went right off the cliff. The EA was free to sell or not, again based on the Supertrend indi.
#2 The short only condition prevailed until the LONG setup arrow appeared, followed six bars later by the SAR OSC confirmation trigger.
At this point any open short positions would automatically be closed and the EA would look to the Supertrend indicator for BUY signals. The right hand side of this chart shows the price action as being negative, so the EA would either have no trades open or a buy trade open that was losing money.
#3 This chart shows that the price action reversed itself and a new LONG setup arrow appears. Since the setup was already in a LONG ONLY condition, the EA ignores this arrow and goes right on opening & closing buy positions based upon the Supertrend indicator.
Actually I find this encouraging in a rather basic EA, don't you Tzuman?
Sorry that my reply is so long, but I was aiming for clarity. Looking forward to testing your new EA this weekend!!
I looked at the traditional parabolic SAR and also tried the inputs you suggested.
You are right; the 0.01 or 0.015 with a max step of 0.01 gives a better match to the ZAZ arrow on June 15, 2011.
Personally, I prefer the SAR Oscillator over the traditional SAR dots, as it gives me a visually cleaner picture (easier for me to read). The two SAR indicators are actually just different ways of expressing the same data, so either one can be used.
Also, after analysing the screen shots you provided, I'm wondering if we will NEED a limit to the number of bars a signal would remain valid or not. Guess we won't know till we test it.