You need to protect your random number generator inside a conditional-if statement
if(counter==0)
{
//generate random number here
counter =1
}
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
Hey Guys,
Wondering if someone can help me on this:
In my code i try to generagte a random number and store it as a variable like this:
rannum=MathRand();
Print ("A: ", rannum);
<I then have lots of other code >
Later on i try to print that exact same number in another print statement...
Print ("B: ", rannum);
Results:
A= 1485
B= 2084
The problem is, I get 2 different random numbers. How can i generate the first number store it into a variable and then use it again later without regenerating it?