Some of my research recently has involved the use of random numbers. In conducting this research, I discovered that when I run an optimization scan using MultiCharts, the program has a tendency to duplicate random numbers across trials, so much so that I tended to see the same random number set appear twice during an optimization. This limited my ability to do research since I'd see every random number set twice.
To overcome this apparent shortcoming in MultiCharts, I wrote a small dll using FreeBasic that allows the user to generate a more robust random number integer by inputting the minimum and maximum values the integer could be. To use this function, the format is:
This will generate a random integer between (you guessed it) 5 and 10. What's nice about this .dll is that it includes a randomize call every time it is asked to generate a random number that relies on the "Mersenne Twister", a method of generating very high quality pseudo-random numbers very quickly. In my experience in testing this function, I did not see duplicated random number sets at all, and there was no degradation in the speed of calculation.
In the attached .zip file, I have included the following files:
1) "randomint.dll" - this should be saved on the c:\ level of your hard drive (i.e., "c:\randomint.dll"
2) "RandomInteger.pla" - this includes the RandomInteger function written in EasyLanguage that references the .dll
3) "randomint.bas" - this is the Freebasic code for the .dll, for anyone interested in toying with it.
If anyone has any questions or suggestions, feel free to share here.