Wednesday, August 18, 2010

Meta-Trader - Double Doji EA

Welcome back Meta-Traders.

As promised, I uploaded the Double-Doji Expert Advisor to my Yahoo group this evening. So how does it perform?

Well I was excited to see that it was up about 7.5% year-to-date with 10% risk on EUR/USD with about equal drawdown.

The graphic on the left shows 2 successful trades in a row - where the system enters on a break below the doji line, and takes profit on the entry point plus or minus the doji width.

Unfortunately, for every other year since 2000, the system lost money with an net negative 10-year result and a even larger drawdown!

I had a number of OrderSend() error 130 issues caused by my TP and SL values being within the Stop Level plus the Spread. So I adjusted the system to send the orders with zeros for the SL and TP, and adjusted the EA to "poach", basically wait around for the TP or SL to be hit, then send the order at the market. This is probably a good practice in EA's to keep the broker from hunting stops.
I also tried cancelling orders after certain number of bars with no action taken. I also tried closing trades and taking any type of profit after a certain number of bars (in a Megadroid-type fashion) with no improvement in the results.

I even tried reversing the logic (which usually seems to be the last step before giving up) to find that didnt' work either.

So what are the lessons learned?

1) Coding a long-term profitable system is not easy.

Sure you can go from concept to code in an hour or 2, but after that, the going gets tough. My buddies Daniel Fernandez and JT (as per his recent post Harsh realities in profitability in coding EA's) know this all too well.

2) The forex market commonly "runs" stop and take-profit levels. Once a key and identifyable stop value is formed, it it usually violated in advance of the meaningful breakout which eventually occurs. This caused some otherwise good setups to go bad.

3) A long-term profitable system is a beautiful thing.

After spending many, many hours on this system, I went back and did a 10-year back-test of Watukushay #2 to remind myself what a long-term profitable system look like.

Watukushay #2 is down about 9.5% year-to-date with 4% risk. But its up nicely every other year since 2000 with an average gain of 21.5% per year with a -16.85% average drawdown.

So i'm back to Asirikuy.com to advance my understanding based on the all the hard work of author Daniel Fernandez. I'm also planning a post with the back test results on WA #2 - without revealing the key logic of course.

I'm also starting to sour somewhat on commercial EA's. Sometimes it takes many months to understand the logic of the system since back-testing will only tell you so much.

So learn from those who have come before you and take advantage of their experience!

Stay tuned for a review of Watukushay #2.

8 comments:

  1. Hello Chris,

    This was a very good post Chris :o) I am glad that you are doing some coding and that you are starting to realize how hard it is to come up with long term profitable systems.

    Now not only is it hard to come up with the logic and program these systems but it is also very hard to trade them due to the periods of draw down they go through. You have opened your Atinalla account right before a draw down period so you should already be experiencing some of these feelings :o). In the end success is much more likely when you understand your systems and know exactly the draw down and profit cycles they might go through. I would greatly encourage you to use Gabor's Draw Down and profit analysis tool available within Asirikuy to get draw down and profit period statistics for the different systems you are using :o).

    Also thank you very much again for all the references within the post, it is great to see that you are enjoying the website and its contents and that you believe they are valuable to other forex traders. I look forward to your post on Watukushay No.2 .

    Regarding the double doji logic. This is a pretty old concept in trading and something I have attempted to do myself. The problems are many and some of the main issues are the whipsaws after dojis and the actual significance this pattern has. Double dojis can happen due to a simple lack of trading activity or they can happen due to indecision (this two effects are very different). The only way to distinguish both events would perhaps be through the use of a volume oscillator. As a matter of fact, many of these small patterns are usually used in conjunction with volume indicators in stocks and futures to measure their true potential. Even though volume perse is not available in FX the tick volume information might be used for this purpose (not the absolute values however but with an oscillator based on tick volume data).

    My experience in automated trading has always shown me that following the "Asirikuy mantra" seems to be the key to succeed in this field. You should understand, expect and evaluate :o)

    Again, great post Chris, it is really great to see all your automated trading career evolution !

    Best Regards,

    Daniel

    ReplyDelete
  2. Hey Chris,

    I can understand your wanting to pull away from commercial EA's. I have always thought along the lines of pessimistic intentions of the EA sellers. At times I see it as kind of a more complicated Zulutrade. In addition to complications of finding out if the system can be worth while as you mentioned, I also feel people basically sell their method to users to generate a profit and not take any market risk in doing so. Risk free currency trading I like to think of it.

    I don't want to say that there are no good commercial EA's or "sold in some way" methods out there. The % chance of finding as such has got to be very small though.

    I see you are having some fun trying out your own stuff. I have been coding in MQL4 for a few months now and I am still managing to learn new things that are important to a good EA... I recently got nailed with the 4 digit/5 digit broker issue. I had no idea the behavior that would happen with this. Using retries/refresh quotes when you send an order. Managing a weekend trade. Hiding your TP in your EA (even if MT4 goes down and you restart it when you have an open trade). I have also been finding some fun little EA tweaks that can help add a little more profit to a little more simple EA. I have been thinking about doing a few posts on these.

    Thanks for you Post and I look forward to hearing more about your endeavors.

    JT

    ReplyDelete
  3. Daniel-

    Thanks for your input and for the kind words.

    Interesting point that the doji can be due sometimes to inactivity and other times due to indecision. And the first thing that happens after the doji is not always reflective of what happens next - as I found out. Probably better to base an EA on what IS happening versus what is NOT happening - meaningful trading in this case.

    Thanks for the reminder about Gabor's drawdown analysis tool. I need to spend some time with that in the next few days and i'll let you know any questions or feedback.

    Finally, i've been pretty fortunate in that I haven't seen much drawdown on the robot's i've been following so far on this blog. I expect to see larger drawdowns ahead and i'm going to deal with that by diversifing across at least 5 different systems, keeping my account sizes small and scaling up slowly. That plus a lot of patience should do the trick.

    JT -

    Good point that the EA should be able to recover and close its own trades if stopped and restarted when a trade is on. Its not a problem as long as the the TP and SL are sent to the broker, but definitely a problem if the EA is "poaching" on position exits. I'm not sure my EA would pass in this case since the SL and TP are calculated at entry and stored locally in memory. This means they are lost at EA restart time. I'll make sure that's part of my testing steps for future EA's.

    Understood your points about commercial EA's. I feel like every time I start with another one, its like starting a new 1000-mile journey -except blindfolded! At least with your own EA's you can understand where holes are - and hopefully avoid falling into them which can cost a lot more than the $97 cost of the latest EA.

    JT - you should blog about what you have developed so far. Even if it doesn't work, its helpful for the rest of us too see.

    Also, if you have what could be a great idea, you don't have to reveal all the logic if its not in your interest to do so. SteveTrade has done a whole series of posts on an EA he developed without ever revealing the secret sauce.

    Thanks for the great comments guys!

    ReplyDelete
  4. If you are looking for the best forex signals service provider. You should try Hot Forex Signal Service. It provides the best buy forex signals and trade copier service. It also provides accurate forex signals and premium forex trading signals service. You can start Trail Forex signals service via $ 21.1 for 7 days.

    ReplyDelete
    Replies
    1. USA Forex Signal provides the best honest Forex signals and profitable Forex signals service. It also provides buy forex signals and premium forex trading signals service. You can start Trail Forex Signals service via $12.6 for 3 days.

      Delete
    2. forex signals are a system utilized by traders to create important decisions about their trade. Forex Trading signals are made available to help traders in making a profit and make their trading journey easier and successful. Forex Signal is extremely important within the trade, it doesn't matter whether you're a beginner otherwise you are an expert trader, you would like these signals for your forex trading unless you would like to lose. They're an excellent tool for you to trade an expert manner and also assist you to enhance your skills and trading strategies.

      Delete
  5. Forex signals come to here to provide you 100% accurate Forex Trading signals to help you to increase your deposit increase your money.

    ReplyDelete
  6. Forex Signals Es is the reliable Forex signals and best forex signals service provider in the world. Get accurate forex signals service by Forex Signals Es.

    ReplyDelete