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
You can also optimise calculations in this way:
It has been said many times: there is no shortcut in MCL, if(a||b|||c||d||e){} all conditions will be checked.
The way out is nesting conditions:
if(a){if(b){if(c){}}} in which case the exit will occur at the first matching condition
But nesting is not infinite either, the most flexible solution is to check the conditions in a loop with an exit :
It has been said many times: there is no shortcut in MCL, if(a||b|||c||d||e){} all conditions will be checked.
The way out is nesting conditions:
if(a){if(b){if(c){}}} in which case the exit will occur at the first matching condition
But nesting is not infinite either, the most flexible solution is to check the conditions in a loop with an exit :
No, but I know Olbanian well :))
Nesting conditions if(a){if(b){if(c){}}} is not good, because all conditions are mutually exclusive, but something does not work with boolean. Probably and most likely I'm doing something wrong. So far I've stopped at making a variable double for each condition and pasting it into the same if() with 4 "or". As I expected, it hasn't affected speed of testing. Same 13 minutes on all ticks for 12 months.
Or maybe this language is calledOblansky?
Nested conditions if(a){if(b){if(c){}} are not good, because all conditions are mutually exclusive. Probably and most likely doing something wrong.
All is good, just remember some identities from Boolean arithmetic, for example: a || b = !( !a && !b ). Then by changing from conjunction to disjunction we can replace check of OR condition by consecutive (nested) check of AND conditions: for example, if (a || b || c) turns, as TarasBY has rightly written above, into
This code is in general faster than the original code with ||, because it is executed only until one of the conditions in the list is true, i.e. until the whole OR operation results in TRU.
All is good, just remember some identities from Boolean arithmetic, for example: a || b = !( !a && !b ). Then by changing from conjunction to disjunction we can replace check of OR condition by consecutive (nested) check of AND conditions: for example, if (a || b || c) turns, as TarasBY has rightly written above, into
This code is in general faster than the original code with || because it is executed only until one of the conditions in the list is true, i.e. until the whole OR operation yields a TRU result.
All is good, just remember some identities from Boolean arithmetic, for example: a || b = !( !a && !b ). Then by changing from conjunction to disjunction we can replace check of OR condition by consecutive (nested) check of AND conditions: for example, if (a || b || c) turns, as TarasBY has rightly written above, into
This code is in general faster than the original code with || because it is executed only until one of the conditions in the list is true, i.e. until the whole OR operation yields a TRU result.
Thank you for your participation! I have 5 different but equal conditions, and if no condition is met, the EA waits for one of them to be met. Therefore, no single form of implementation has proved to be better, despite my efforts. Therefore, I will stick with my "pies" for now.