**APeng:**

Hello!

I am running an EA that puts every hour an order wiht random direction and close it one hour later again. I want to run it 1000 times to show that the results are normal distributed.

before MathRand(), I get 1000 times the same testing results as MathRand() is always seeded in the same way. Right?

Now I am running the optimization without MathSRand(TimeCurrent()) and the results seem do be different. I just need to know if I am right as I do not exactly know how the random function is working.

Thanks!

1) TimeCurrent() is the broker-time in backtesting and MathRand() is placed in init() it should be always the same, but if this is intended to be sure try to use: MathSrand(1);?

2) If this is not intended follow the recommendation of mt4's reference: MathSrand(GetTickCount()); (or at least TimeLocal())

3) To have a random 0 or 1 simply use MathRand()%2 - this is either 0 or 1.

Hello!

I am running an EA that puts every hour an order wiht random direction and close it one hour later again. I want to run it 1000 times to show that the results are normal distributed.

When I usebefore MathRand(), I get 1000 times the same testing results as MathRand() is always seeded in the same way. Right?

Now I am running the optimization without MathSRand(TimeCurrent()) and the results seem do be different. I just need to know if I am right as I do not exactly know how the random function is working.

Thanks!