MQL4 Reference
Math & Trig
MathSrand
| void MathSrand( |
int seed) |
The MathSrand() function sets the starting point for generating a series of pseudorandom integers.
To reinitialize the generator, use 1 as the seed argument. Any other value for seed sets the
generator to a random starting point. MathRand retrieves the pseudorandom numbers
that are generated.
Calling MathRand before any call to MathSrand generates the same sequence as calling MathSrand with seed passed as 1.
Parameters:
| seed |
- |
Seed for random-number generation. |
Sample:
MathSrand(TimeLocal());
// Display 10 numbers.
for(int i=0;i<10;i++ )
Print("random value ", MathRand());
|
|
|