Is it possible to avoid many "ors" (||) in conditions causing the same action? - page 10
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
This question of speed is what moved me to address the esteemed forum members, "how to avoid a lot of "or" ...", because I believed that it causes a loss of time. And if some are moved to enter into polemics because of their ambitions, or persistently promote their developments, it remains their personal business, and does not concern me. Anyway, thanks to all who responded! And I wish success to all!
First learn how to work with your brain, you have already learned how to work with your tongue. Good luck!
From what I understand, there will be no result. Pity. Although it doesn't take long to do (if necessary), there are plenty of options offered
On the previous page I reported the preliminary result to Alexey (Meat) and my explanations, which I now give you in full:
I've tested all suggestions and it turns out the fastest one is: if (A || B || C || D) Action();
I wonder how it could be faster than this: if (A) Action(); else if (B) Action(); else if (C) Action(); else if (D) Action();
I wonder how it could be faster than this: if (A) Action(); else if (B) Action(); else if (C) Action(); else if (D) Action();
In principle, not a problem. I can get the results myself. Numerical results
Victor, just now I finished cleaning the code, like flats after renovation, I cleaned a lot of rubbish, such as unnecessary conditions, unnecessary normalizations, corrected the logic, reduced the number of used functions. Alexey(alsu) helped me a lot with his advice, and I am grateful to him for that. As the result the 4 month long run in the tester was a bit longer than 2 minutes, and I was satisfied with it. And bool's functions turned out to be unnecessary, because they didn't give me any speed advantage, but they gave me some experience in working with them which will come in handy later.
I thank all who took part and wish success and good profits to everyone!