In my tester the EA I created is working as I wanted. Know on demo I see that the results after a ew OnTick occured are different.
Well in the new OnTick part. I first fill two array's (values from some indicators...360 bars back) get the incoming new tick and put it in a array. After that I do some checks.
I noticed that on the demo account some checks now make no scense at all!!A closeprice above eg SMA200 is suddenly below SMA200...in the next tick...it's suddenly correct again....
But on the tester it works like a charm!! Is it possible that I need some waitingtime....before everything is written? Or can I assume that the tester-test needs to be the same as the Demo account.
I ask this because I can imagine that there is an OnTick() active, the EA is starting to do the job....but the last tickinfo is not yet completely written. When that is true It's possible that I want to ask the lastclose price...and it's empty at the moment...
Hope some can help me.
I don't really understand your question, but I'll try to response with what I think you are asking.
One of the common optimization bias is the use of future data in the backtesting process. For example, if you use the close price of the current candle to make a decision within the current candle, you have committed this bias. This is because you are not suppose to know where the current candle closes while you are making your decision.
To overcome this, you can use open price instead of close price. The idea is that the current open price is the previous close price, and it will not vary with ticks. Do note this this will introduce some lag into your system, which will cause the result to be worse than before.