![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
We can accelerate further, for example if we know that condition A is on average satisfied more often than C and C more often than B, then we should put them in that order: if(!a){if(!c)if{(!b) M=false;}}
You can speed things up even more by combining the probability of a condition happening with its computational complexity: for instance, taking as a criterion the product of the probability of happening by the value inverse of the computation time, the first conditions to be checked are those which are the most probable and have the lowest computational complexity, i.e. those which have the highest value of our given criterion.
You can also optimise calculations in this way:
Or maybe you could try it this way:
Thank you!
You can speed things up even further by combining probability of a condition with its computational complexity: for example, taking as a criterion the product of probability of execution by a value inverse of computation time, first check those conditions which are most probable and have the lowest computational complexity, that is, those which have the highest value of our given criterion.
I put them in that order a long time ago. But even if more than one condition is fulfilled, the first one that comes up will be fulfilled.
And it doesn't matter, because then the final conditions are common for all variants.
You can speed things up even more by combining probability of a condition with its computational complexity: for example, taking as criterion the product of probability of execution by the value inverse of computation time, first check those conditions which are most probable and have the lowest computational complexity, i.e. those which have the highest value of the criterion we set.
None of the operators fit. Is there any other way without if(A || B || C || D || E) Action;?
I ask moderators not to send to general questioners thread due to importance of the question I'm thinking about and can't find a more rational solution! Thank you!
if(A || B || C || D || E) Action; I would do thisif((A + B + C + D + E) > 0) Action; ifAction needs at least 3 signals, write 2 instead of 0
the speed, I didn't measure it.
if(A || B || C || D || E) Action; I would do thisif((A + B + C + D + E) > 0) Action; ifAction needs at least 3 signals, write 2 instead of 0
speed, I did not measure
The speed would be tremendous. The solution is very original
The acceleration will be tremendous. The solution is very original.
If A,B,C,D are functions, you have to count by complexity, starting with the easiest one, and constantly check for truth. It will work faster that way.
Thank you for your participation! A, B, C ... not functions, but conditions containing functions and not containing functions, and furthermore mutually exclusive! And one condition is enough to jump to other conditions that already trigger action. If there were only functions, then there wouldn't be a problem:
double A = function1(); double B = function2(); double C = function3(); double D = function4(); double E = function5(); and then as Pako suggested:
if((A + B + C + D + E) > 0)
{other condition with mirrored direction to close Byes or Sells} action;BUT:
And I need A = condition1, B = condition2, C = condition3, D = condition4, E = condition5. Is it possible or not! Or is it impossible and that's it!
For example:
I don't know what to try!
And I need A = condition1, B = condition2, C = condition3, D = condition4, E = condition5. Is it possible or not?! Or is it impossible and that's it!