Something is WRONG but I dont know what it is

If you found an indicator that was top-notch (not perfect, but A+ class) and built an EA to use. IF you then back-tested that EA and found it gave spectacular results consistently, for 7 years worth of historical data WITHOUT being optimized, curve-fitted. If you looked at the summary reports from back-test and the profit factor was incredible (over 100), the draw-down reasonable, percentage of win trades to loss trades = 80%. If the EA was non-scalping, non-hedging, multi-currency (including Asian), could be used during the news and small hours of the morning.

Would you ask yourself “Is this too good to be true? How come I’ve stumbled across this? Surely someone has already done what I’ve done with this indicator!”

Would you not be a little suspicious? If you had such a succesful EA, why bother sell it - you can make more money using it. And why bother post it in the public domain?

And then you FORWARD test it a little, and the real world then hits you…

Just make sure when you forward test, you are giving it a good chance to succeed. You might just have hit a bad run. 3 months is a good benchmark.

The back tester in MT4 is not as accurate as forward testing. It does not hold 100% accurate data.

What this means in reality is that EA’s can work fantastic in the backtester and fail to work in forward testing. Not having 100% accuracy means that price action is different altogether. I am not an expert in MT4 but I know from experience that EA’s I have which work great in demo and live, run out of equity and fail in the backtester.

I only every forward test.

you said
"Would you not be a little suspicious? If you had such a succesful EA, why bother sell it - you can make more money using it. And why bother post it in the public domain?"

keep that thought, it might save you a lot of money and time.

Not true, you can make way more money selling it. Forex is over a 3 trillion dollar market with the majority of trades coming from banks and funds hedging positions or converting currencies A.K.A not looking to speculate for profits. Therefore, selling an EA in the forex market will not have the same effect as it would with stocks. If thousands of people are using your retail EA, it will not have an affect on profits or be a self-fulfilling prophecy because volume is so big. In the stock market, this is a different story. Therefore, if you have a great EA that could be retailed why not use it with your own money AND sell it retail to make even more money. Maybe it doesn’t trade very often (several times a year), but you would like a consistent cash flow? Then it would make sense to sell it to others.

If you have an EA that does this, please share. They are very hard to come by and nothing is the holy grail. Eventually market conditions will change, and the EA will be less effective. The key is knowing when to stop using one (selling an EA is a good way to diversify this risk).

Because alot of people will think: “If this EA is so good, why is this guy selling it for xyz bucks, instead of just using it to earn a living for himself? It cant be any good”… thats how the thinking goes, anyway. There are innumerable posts by people looking for a “good EA”, usually for free. I subscribe to the thought that if its any good, it doesn’t need to be sold, and its probably not in the public domain…Actually, speaking personally, if I developed a really good EA, spent six months+ to year of my time on it, testing it, improving it, etc, why should I give it away free?

You’re right. If you consider the amount of work that goes into learning how to trade - it can take years just to become proficient - then learning how to program or paying someone to do it for you. Consider the effort that goes into developing a half decent strategy too. After all this, would YOU sell it to the masses on the internet ?

innumerable people want money free and easy. Everyone hopes someone will be kind enough to hand them free money on a plate. It doesnt work that way.

If you had an EA that worked well, wouldnt you set it up for your family and friends first rather than sell it to people who you don not even know ?

“innumerable people want money free and easy. Everyone hopes someone will be kind enough to hand them free money on a plate. It doesnt work that way.”

Exactly…you trade with it using your own money, and sell it to the masses who are praying for money growing on trees to diversify your risk as well as add to your profits. Why would you put all your eggs into one strategy?

The only true measure of any methodology is through forward testing. Anything can look pretty in the past when human psychology is taken out of the picture. And the past is always predicable. In fact, I predict that I’ll be born on June 9, 1979. But I bet If I future test that predication, I’ll be on the losing side of that position.

Dont worry its just part of the learning process. There’s at least one trader I know whose whole strategy is based on fading optimied backtests.

Alternativey the EA is making postdictive errors (an awful lot of the EA’s in the public domain do !)

If its a commercial EA, its also possible that the MQL code has been modified to prevent trades being taken during particular periods where losers occur in back testing. Thats quite a common trick vendors are using these days.

Hi simba

Sorry, but what are “postdictive errors”? And you should be clear on the fact that I am/was talking about an EA I am currently developing. I am new to forex (less than a year) and I have (self-) doubt that the EA I’ve written is any good. It’s not the first I’ve written (wish I had GBP10 for every EA I had written!) but it’s the first one that a) has not stopped lossed out in backtest and b) consistently made ‘profit’ regardless of which years I tested it on. Also, the profitability of it is literally off the chart, in back-test. Do you understand why I have doubts about it?

Having said that, I’ve hit several issues in forward-testing (demo): the indicator gives duff values going forward, but I’ve coded a workaround. Handling a re-quote is still currently an issue, but I’m working through them. Hopefully in a months time I’ll be in a position to go live, risking a real amount of money (At the moment, in addition to demo, its running on a live account, albeit with incredibly small lot sizes)

good luck with that.

there is code available for handling trading errors, including requotes

Usually these situations arise in backtesting where you are looking into the future. A common mistake might be trading signals on say a 5 min chart, but using an indicator based on the close price of the daily chart. In real time it’s OK, but in backtest, you end up using the value based on a close which of course is looking into the future (which tends to give good results !)

If you see something that looks too good to be true it usually is, and for me, backtesting is more about proving something doesnt work. I coded up a strategy a couple of weeks ago, the backtests originally looked fantastic, I forward tested and made money everyday, the idea on which the strategy was based seamed sound enough, but the backtests just looked too good to be true, and of course, they where, it was a coding error, and the forward tests results where nothing other than good luck.

Like you, I’ve also experienced problems with indicator values being incorrect, both in real time, and in backtest. If I’m testing TA based strategies I always try to log the value of indicators at the point trades are made, and then check a few of them against the charts to determine that they where calculating OK. MQ4 can be a really tough platform to do this kind of work on

Yeah, I think my results are due to this - they’re too good to be true, and I am using an indicator working on a higher timeframe while trading on a lower. Thanks for your explanation!

Like you, I’ve also experienced problems with indicator values being incorrect, both in real time, and in backtest.

There’s something about iCustom, it returns different results than if the indicator is running on a chart - and yes, I do know how to call iCustom correctly. But there’s a way around it - check my posts for a workaround

Thanks, will do.

Thanks. I prefer to do my own error-handling. Apart from the indicator (which I have modified anyway) all code is 100% my creation. Means I cannot blame anybody when/if I toast an account.

That suggests a flaw in StrategyTester, wherein it is looking ahead using downloaded historical data.

I’ve also noticed that the indicator signals given in forward-testing in realtime are more frequent, and do not match up to the signals if the indicator is run over the same data historically (hope you understand what I mean). When an indicator is first added to a chart, I know it calculates a large number of historical bars up to Bar 0 (about 1000 bars?). Thereafter, every time a tick comes in the indicator start() function runs.

Would it be wrong to modify the indicator to always look at completed bars and not ticks. Also, since I’m using a zigzag based indicator, to make it recalculate maybe a third of historical bars. I’m using M15 timeframe for trading, so I do not think it would be computationally ‘heavy’ to recalculate 300 bars every 15 minutes.
What do you think?