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"
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??

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
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:
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