BUG: MathRand and MathSrand

 

1. There is old bug where MathRand() used in this same loop not generating nothing new but it's still this same value

https://www.mql5.com/en/forum/368587


2. Looks similar old error where usage of MathSrand() blocking trading.. and in any case of:

MathSrand(TimeCurrent());

MathSrand(GetTickCount());

..not giving nothing new, and the seed not working

Looks this variable is <coarse language removed by moderator> totaly

https://docs.mql4.com/predefined/_randomseed

Problem with MathRand() in StrategyTester
Problem with MathRand() in StrategyTester
  • 2021.05.04
  • www.mql5.com
Hi,I'm new to programing. I have problems using the Mathrand() function in the strategy tester...
 

Please watch your language.

Forum on trading, automated trading systems and testing trading strategies

General rules and best practices of the Forum.

Alain Verleyen, 2018.08.03 22:42

The rules

Forum rules, enforced by moderators, please respect them :

  1. Please be polite when communicating on this website. Refrain from statements that may offend or insult other users.
  2. Negative discussions of any banking, brokerage and other financial institutions are not allowed.
  3. Any discussions about personal relations between the community members are not tolerated.
  4. Coarse language, advertising messages, spamming and flooding are forbidden.
  5. Repeated violation of the Rules, ignoring moderator's remarks and open disrespect for the website Administration will lead to an account termination.
  6. The website Administration may implement any changes to the Rules it deems necessary.
Term of use of the site.

 

Forum on trading, automated trading systems and testing trading strategies

General rules and best practices of the Forum.

Alain Verleyen, 2023.03.28 20:04

Please don't post randomly in any section. Your question is not related to the section you posted.

MT4/mql4 has it's own section on the forum.

I have moved your topic to the correct section.


 

It's should be testes especially in tester.


@Alain you can move this thread to MQL4 and MetaTrader 4 (my mistake).

 

As far as I am aware, you are only supposed to be calling MathSrand() once to seed the generator, and from then on, call MathRand() subsequently to generate a sequence of random numbers.

So, I am not quite following what it is that you are reporting.

Can you please provide example code and sample output showing the issue you are reporting?

 
Fernando Carreiro #:

As far as I am aware, you are only supposed to be calling MathSrand() once to seed the generator, and from then on, call MathRand() subsequently to generate a sequence of random numbers.

So, I am not quite following what it is that you are reporting.

Can you please provide example code and sample output showing the issue you are reporting?

I do agree. I don't see what the problem is.
Reason: