Stupidly Good EA - worthless and I don't know what it is doing

 

Hello everyone,

does this picture look to good to be true? Obviously it is. Oh, how I wish it was true! Not that I have deliberately faked anything, but even the most optimistic person would realise that this cannot represent real results in the real world.

Anyway, here is the thing. I wrote an EA (I am pretty new to this) and thought I was writing something correctly. Naturally my code was buggy, but it gave an unexpected result.

This EA takes a single indicator, runs a test on it, and then may enter a trade. It's a scalping EA, and not particularly sophisticated. It sets a Stop loss of 5 pips, and a T/P of 15. It has a set risk of about 1% of the total capital, and adjusts the lot size based on the capital.

I have tested this in the period 2005-2006. The graph goes up amazingly from 2000-2007. It goes up pretty well afterwards, but not quite as spectacularly.


The problems:

1) I have NFI what it is doing. I checked the visual chart in MT4 and it was doing nothing like I expected. Then I checked my code for the problem. The basic logic of the EA was this:- compare the current candle when it closes to the previous candle. If some tests are passed, then trade as the new candle opens. I got it wrong. When the new candle opened I ran the logical tests, and the 'position' of the indicator was 0 (for the current candle) and 1 (the previous candle). They should have been 1 and 2. Because I waited until the next candle had opened, by using "0" I was now testing the brand new candle. I have no idea what the hell data the EA is using - I would have assumed the value would have been identical to the close of the previous candle, but it is radically different.

So, does anyone know what data the EA could be using?

2) The EA only works on extremely low spreads. It is reliably profitable for anything below 1 pip (so long as that value is fixed) and starts to make silly profits when the spread gets lower. It seems to work on any pair (I have been able to catch about 9 different pairs when their spread is that low and run the backtester) and across multiple timeframes. The lower the spread, the shorter the timeframe it works on.

Does that have any practical use? I have been looking for brokers with fixed low spreads to run a demo account, but it seems like the EA would need some pretty rare conditions to be successful. I have come across one that offers 0 fixed spread, but doesn't allow EAs, doesn't have a demo available for that account, and has only 4 digits of precision for the spread (which means that their spread may be up to 0.9 pips)


My current expectations are that I have accidentally encountered a quirk in the way MT4 works, and if some of the experienced coders were to laugh and say 'yeah we have seen these silly EAs before and they dont work in real time' then I wouldn't be at all surprised. I also suspect that even if the EA works that there would be no environment that would allow it to work successfully. I'd love to find out what it is doing though, and see if that knowledge can be used to make a reliable, useful and at least modestly profitable EA...

So has anyone seen anything like this before? Or does anyone know, at the very instant a candle opens, what data it uses in it's indicators (or are there any known quirks in this)?

Thanks in advance for any help!

 

R

> Does that have any practical use?

I very much doubt it - this type of system can work on backtest (fixed spread), on demo account forward trading (fixed spread )
But then comes completely unglued in the live account environment with its variables spreads, more gaps, missed ticks and the resulting effects of these on indicators
All contributing to false signals and nil-profit/extra loss situations
Good Luck

-BB-

 
 
1005phillip:

You should read this: https://www.mql5.com/en/articles/1413


Humm... Yeah I'd say unrealistic environment. This made me double-check my potential broker's spreads. I've been back testing with their fixed environment. This one got me worried "Our spreads may be increased with news or other high / low volume conditions" from FxOpen. Phillip (Sensei), have you heard/experience excessive spread increases with FxOpen?
 
1005phillip:

You should read this: https://www.mql5.com/en/articles/1413



I think that is the best read.

I wonder if there is a record for the most wildly successful psuedo 'Holy Grail'?

 

> have you heard/experience excessive spread increases

Define excessive...? I think any variation will break the above EA..
The downside for todays smaller minimum spreads is the more direct exposure to market action. with consequent spread variation, gaps etc
Most brokers will have these variations, if yours doesnt at present, this will likely change - so.. your system & EA have to handle these things
PS we cant discuss individual brokers here of course :)

-BB-

 
All of my systems test with a Sl/Tp of least 15 points. The ones I've kept have Sl of least 50 points. System above have 5 points Sl. Of all the brokers I seriously considered none had Sl of 5 points. Thats not to mean they don't exist. If a broker moves their advertised spread on average 1 per week, Me/Myself &/I would consider that excessive. I agree that brokers should have the ability to protect themselves but that should be reserved for doom's day scenario. Example 9/11. Not everyday new releases or if volatility increases. If anyone knows if FxOpen moves spreads once per day please comment here. Thanks.
 

Besides all of the above, there is the issue on how exactly the MT StrategyTester interpolates the ticks within the bar, actually there is only 4 constants when talking about a bar, the Open, Low, High and Close, and by watching those values, you cannot know what's happened between the Open and the Close, except that at some point the Low and High was hit, but not the order in witch it was hit.

So, for myself, I discard any trade that has opened and closed within the same bar, plus the trades that have SL and TP within the same bar (regardless of witch one was hit). In your case, as a scalping EA, I assume that you have many trades (even loosing ones) that opened and closed within the same bar.

See if this is the case or not.

PS: IMHO testing an EA with such low TP and SL, is quite useless since the StrategyTester is flawed by design in this situation.

 
BarrowBoy:

PS we cant discuss individual brokers here of course :)


Yeah well we also aren't supposed to have spammers advertising dresses and cleavage either (back to back days no less!) but I don't exactly see a moderator presence of any sort these days around here so it is pretty much the wild wild west folks. The party has moved to MT5.

ubzen:

Humm... Yeah I'd say unrealistic environment. This made me double-check my potential broker's spreads. I've been back testing with their fixed environment. This one got me worried "Our spreads may be increased with news or other high / low volume conditions" from FxOpen. Phillip (Sensei), have you heard/experience excessive spread increases with FxOpen?


I have no experience with FxOpen, but in regards to spreads in general regardless of broker it is a good idea, and a fun learning exercise, to develop a spread tracker that records (csv) the spreads as a function of time. Do an analysis of the results and be surprised at just how often spreads are widened, you will probably be surpsied at the data. (both duration, magnitude, and frequency merit study)


 
Aw man, lol I'm disappointed already. No wonder people blame brokers when they fail. It's hard enough to make a penny out of a dollar. Brokers advertise Forex compared to stocks as if it's a commissions free trade. Sad part is some Seasoned Traders try to treat Spreads like it's not Important but your actual trading Alone is. I've seen Newbie systems which would be high performers if they didn't have the spread. Seems pretty important to me.
 
csebastian:

Besides all of the above, there is the issue on how exactly the MT StrategyTester interpolates the ticks within the bar, actually there is only 4 constants when talking about a bar, the Open, Low, High and Close, and by watching those values, you cannot know what's happened between the Open and the Close, except that at some point the Low and High was hit, but not the order in witch it was hit.

So, for myself, I discard any trade that has opened and closed within the same bar, plus the trades that have SL and TP within the same bar (regardless of witch one was hit). In your case, as a scalping EA, I assume that you have many trades (even loosing ones) that opened and closed within the same bar.

See if this is the case or not.

PS: IMHO testing an EA with such low TP and SL, is quite useless since the StrategyTester is flawed by design in this situation.


I'll check this out. This may be part of where the EA is broken and the faults are occurring.


Thanks for the advice :)

Reason: