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:
Code: Select all
value = RandomInteger(5,10)
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.