MathRand - Math Functions - MQL4 Reference

MQL4 Reference Math Functions MathRand

MathRand

Returns a pseudorandom integer within the range of 0 to 32767.

int  MathRand();

Return Value

Integer value within the range of 0 to 32767.

Note

Before the first call of the function, it's necessary to call MathSrand to set the generator of pseudorandom numbers to the initial state.

Note

Instead of MathRand() you can use rand().