puncher:
For example, I have five values in array named MyLots[]
double MyLots[] = {0.01, 0.02, 0.03, 0.04, 0.05};
Array MyLots[] contains five values and now I would like to GET random value from the array table whenever I send open order.
Can I please MQL syntax - how to GET random value from this array ?
For example, I have five values in array named MyLots[]
double MyLots[] = {0.01, 0.02, 0.03, 0.04, 0.05};
Array MyLots[] contains five values and now I would like to GET random value from the array table whenever I send open order.
Can I please MQL syntax - how to GET random value from this array ?
MathSrand(TimeLocal()); int num = MathRand()%5; // random number between 0 to 4 (even distribution) double result = MyLots[num];
Please also see info in this recent thread: https://www.mql5.com/en/forum/125208
Thank you GORDON.

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
double MyLots[] = {0.01, 0.02, 0.03, 0.04, 0.05};
Array MyLots[] contains five values and now I would like to GET random value from the array table whenever I send open order.
Can I please MQL syntax - how to GET random value from this array ?