EA with different results on Single/Optimation and Visualisation

 

Hi everyone,

I am new to coding and was trying to make an EA just for Backtesting some CustomIndicators. It is a little Patchwork of all the Informations I was looking at:
It is testing 28 currencys with one Indicator running over all of them on the D1-Chart.

Well now I want to test it or want to optimize it. My problem is, that I get diffrent results in the Optimation/Single-Test and in the Visualisation (Screenshots attached).

Can anyone tell me what I did wrong in this code that the results differ?

I get the same Results everytime I run it. I have allready emptied the cache of the Tester. I also attach the code. Maybe some of you can find the Problem there.

Would be happy if anyone can help there. I am on the limit of my knowlegde.



Edit:

If someone new to this has the same Problem:
My Problem was the modelling Mode I was using. I used "Open Price only" what seems to be prety accurate in Visualisation but it fails hard in Optimazionmode. Using Real Ticks is giving most accurate results. You can use 1 Min OHLC for faster results. The results with this modelling are still consistent over all tester modes.

Now I have to code my EA that it is possible for me to only use the OpePrice only. Wish me luck ;)

Testing trading strategies on real ticks
Testing trading strategies on real ticks
  • www.mql5.com
The article provides the results of testing a simple trading strategy in three modes: " 1 minute OHLC " using only Open, High, Low and Close prices of minute bars; detailed modeling in " Every tick " mode, as well as the most accurate " Every tick based on real ticks " mode applying actual historical data. Comparing the results allows us to...
Reason: