I'm testing a EA on a DEMO Account and on REAL Account at the same time (2 sessions of MT4 running over different accounts, same machine, same EA) and results are quite differents...
Can anybody tell me why?
I do understand what you said, but I still have a doubt:
If a use the MT4 STRATEGY TESTER on a DEMO Account I have some results, and with the MT4 STRATEGY TESTER on a REAL Account the results are differents. I have executed both at the same time, same moment in time...
Why is this happening?
For consistent results in the Tester u need identical History Data and identical
Market Properties (in the Tester -> press 'Symbol properties'...). If there are differences in either, then results will differ.
Regarding Demo vs Real - as wackena said there are technical differences between the two. But let me add that even if u run your EA on 2 Real accounts in 2 Terminals on the same computer, then you will still likely have subtle differences... There are several technical reasons for the differences - each Terminal will receive a slightly different Tick stream, each Terminal will experience slightly different latency/timing issues and for each Terminal the broker's server might behave differently when processing requests...
You also need to be aware that the candle time in the hst file is defined by the server time...if the demo server clock is not synchronized to the same source clock as the live account server then the same price feed will still result in differing hst files as the Open and Close value for each candle will occur at a slightly different market time (not the same thing as server time unless the server clock is perpetually synchronizing) for small time-shift errors and can result in the high and low values being incorrect as well if the time-shift is large and the data ends up incorrectly captured as belonging to neighboring candles.
A couple years ago this was a huge issue with customer's demoing IBFX because the demo server timestamp was nearly 3 minutes (!) off from the live server. M1 candles on demo accounts were entirely stamping at a different time than the live accounts...this condition persisted for months and accumulated a lot of feedback in their forums. Moral of the story is don't assume that even the large(r) brokers are on top of everything.
Demo accounts will never be the same as live accounts if the broker is running price feeds off of different servers, everything involving loading dynamics and hardware configuration specifics can and will be different.
All of these factors are NOT strong enough to damn the efficiency of a good up and running Expert Advisors: Only on very rare instances that such flimsy factors could hinder order calls either in terms of order placement, stop-level, order-close request etc and also mostly during high volume market period.
However, these factors could be remedized by adequately putting them into vivid consideration during trading strategy developments. Professional gurus Traders/EA Specialist could see a light into what I am saying here!
People also tend to forget that the FX market is still a market place where prices are negotiable and change. People often prefer(incorrectly) to liken their broker to a supermarket, where you pay the price you see, rather than a free market(or auction house if you wish). Your broker still needs to find some-one to take your order. I like to think of the market as a fruit and veg store with a big sign outside that says "Apples $1 a dozen, while stock last". You and Joe Blogs next to you may be admiring the apples through the shop window and if you both decide at once that you want the apples, only 1 of you is going to get the apples, even though both of you were looking at the same thing. Both of you will come out the shop with some apples, but the chap that got there first will have the nice ones.
The same applies to the FX market......brokers have their systems configured to cope with a certain depth of liquidity which is a balance between spreads and execution. If 50 traders decide all at once to make the same trade, they will be consuming the available liquidity and something has to give. This means the spreads will widen(briefly) and some people will be slipped, paying a higher price if they are buying. This is how a market works......demand changes the price. The same goes for your live accounts side by side......they may see the same datafeed and react in the same instant, but one of them may lose out as there is a limit to how many orders the broker can execute at a given price before the demand drives the price. It goes without saying that demo accounts cannot simulate this liquidity issue exactly, so there will be even bigger differences there.
People also tend to forget that the FX market is still a market place where prices are negotiable and change. [...]
All of these factors are NOT strong enough to damn the efficiency of a good up and running Expert Advisors [...]
make sure that you are connecting to the same servers. If the times are different, the charts are different.
In my experience, my demo and real work identical on IBFX broker servers, side by side, a few pips off there and there. If it is different results on the same server, then your EA must be the issue.