Try /double(Total)
fly7680:
I have a small problem with the operator "/" I have no compilation problems but this counters block me the strategy tester
If any number is divided by zero, then we get infinity. Therefore, you can not divide by zero. In this case, you always get an error.
Metaquotes, please implement try catch!
Victor Ziborov:
If any number is divided by zero, then we get infinity. Therefore, you can not divide by zero. In this case, you always get an error.
Great, I was reasoning and in fact I solved adding an if ()
// Global scope int A=0; int B=0; int Total=0; double Percent=0; int start() { // my code if(Total>=1) Percent= (A*100)/Total; }Thanks to everyone for the answers !!!
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have a small problem with the operator "/" I have no compilation problems but this counters block me the strategy tester
If not insert /Total code works otherwise no