My CSignalRandom isn't Random. Please Help Me - I know about MathSrand()

 

I'm developing a Random Signal and it looks like if this isn't as easy as I thought.
the intention to allow some sort of variance even in the tester.

But the problem is that every tester run is the same, no variance at all.

 Here is my code:

int CSignalRandom::ShortCondition()
{
   int result=0;
   MathSrand(TimeLocal());
   if (MathMod(MathRand(), m_rand_chance) == 0) {
      result = 100; 
   }

   //--- return the result
   return(result);
}

 m_rand_chance is an integer e.g. 10 meaning a short condition is signaled every 10 bar (in average). 

How to make this really random, even in the tester?

Daniel 

 
CSignalRandom() {MathSrand(TimeLocal()))};

int CSignalRandom::ShortCondition()
{
   int result=0;
   if (MathMod(MathRand(), m_rand_chance) == 0) {
      result = 100; 
   }

   //--- return the result
   return(result);
}
MathSrand must be execute only once. For example, constructor can containe it or function like "Init"
 
notused:
MathSrand must be execute only once. For example, constructor can containe it or function like "Init"

I already tried this. But still get the same result on every tester run. Seems like the random seed is cached?

other solutions??

Reason: