Optimization Error Please help New comment Lativ_ 2022.05.31 10:30 Hello I'm trying to do some calculations with strategy test math calculations. Optimization high results do not match re calculated ones. I don't know what is wrong, can someone help me find the error. //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ double Eq() { for(int i = 0; i < numPatterns; i++) { sum = 0.0; for(int z = 0; z < nINPUT - 1; z++) { sum += (w[z] * X_[i][z]); } if(X_[i][nINPUT - 1] == 0) if(a(sum) == 1) g = g - 9.25; if(X_[i][nINPUT - 1] == 1) if(a(sum) == 0) g = g - 1; } return(a(sum)); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ double a(const double sum_) { if(sum_ > t) return(1); else return(0); } //+------------------------------------------------------------------+ //| Tester function | //+------------------------------------------------------------------+ double OnTester() { in(); Eq(); return(g); } //+------------------------------------------------------------------+ As you can see on the images, the lower results run OK but the maximum one do not Files: Untitled.png1.png 28 kb Untitled.png2.png 34 kb Untitled.png3.png 29 kb Untitled.png4.png 34 kb Single EA strategy test not matching strategy optimization results Help fixing code for detecting tops and bottom in stochastic convert to MQL5 , find the error New comment
Hello
I'm trying to do some calculations with strategy test math calculations.
Optimization high results do not match re calculated ones. I don't know what is wrong, can someone help me find the error.
As you can see on the images, the lower results run OK but the maximum one do not