How to GET random ITEM from the ARRAY defined as DOUBLE type ?

 
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 ?


 
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 ?
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

 
gordon:

Please also see info in this recent thread: https://www.mql5.com/en/forum/125208


Thank you GORDON.
Reason: