
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
Time for my own geeky suggestion...
Another option is to generate a larger range of random numbers. For example, combining multiple calls to rand() in order to generate a 64-bit (ulong) number. The output % 5 then still has bias, but becomes reduced to infinitesimal proportions. Also provides an answer if you need a range of random numbers larger than 32768.
For the full geek effect, the following GetRandomNumber() will use Windows API calls if available, and only fall back to the above function if "Allow DLL imports" is turned off. Microsoft say that this is "far more random than the data generated by the typical random number generator such as the one shipped with your C compiler"; in other words, far more random than what MT4 will be using.