Errors, bugs, questions - page 2658

 
Nikolai Semko:

Igor, then try MathSrand(int(GetMicrosecondCount()%16384));

I wonder how the picture will change

int OnInit()
   {
   MathSrand(int(GetMicrosecondCount()%16384));   
   return(INIT_SUCCEEDED);
   }
//+------------------------------------------------------------------+
void OnTick()
   {
   }
//+------------------------------------------------------------------+
double OnTester()
   {
      return(rand());
   }
//+------------------------------------------------------------------+


 

Such a problem.

CSymbolInfo class.

When referring to the current Ask or Bid price, it returns 0.

All other parameters work fine, e.g. AskHigh or Point

 
Ruslan Udintsev:

Such a problem.

CSymbolInfo class.

When referring to the current Ask or Bid price, it returns 0.

All other parameters work fine, for example AskHigh or Point

I need to update prices first.

//+------------------------------------------------------------------+
//| Refreshes the symbol quotes data                                 |
//+------------------------------------------------------------------+
bool RefreshRates()
  {
//--- refresh rates
   if(!m_symbol.RefreshRates())
     {
      if(InpPrintLog)
         Print(__FILE__," ",__FUNCTION__,", ERROR: ","RefreshRates error");
      return(false);
     }
//--- protection against the return value of "zero"
   if(m_symbol.Ask()==0 || m_symbol.Bid()==0)
     {
      if(InpPrintLog)
         Print(__FILE__," ",__FUNCTION__,", ERROR: ","Ask == 0.0 OR Bid == 0.0");
      return(false);
     }
//---
   return(true);
  }
 
Igor Makanu:


Wow. I don't get it.
 
Nikolai Semko:
Wow, I don't get it at all.

What is there to understand? - in the tester GetMicrosecondCount() , GetTickCount() , GetTickCount64() are bound to the tester starthttps://www.mql5.com/ru/forum/35402/page5#comment_15165640

and MathSrand(GetTickCount()) construct from the help;

the developers should have done both the Print() operation - it does not output messages in the tester in GA mode ,

and MathSrand(GetTickCount()); should be initialized by time ..... who knows what time, but not by GA start time - now MathSrand() does not work as expected

 
Igor Makanu:

What is there to understand? - in the tester GetMicrosecondCount() , GetTickCount() , GetTickCount64() are bound to the tester starthttps://www.mql5.com/ru/forum/35402/page5#comment_15165640

and MathSrand(GetTickCount()) construct from the help;

the developers should have done both the Print() operation - it does not output messages in the tester in GA mode ,

and MathSrand(GetTickCount()); should be initialized by time ..... who knows what time, but not by GA start time - now MathSrand() does not work as expected

so it's not the time to use for scrand, but some handle which changes every time.
 
Nikolai Semko:
so it's not the time to use for srand, but some kind of handle that changes every time.

I know how to solve this problem - I'll take the time in WinAPI, but is this another feature that needs to be constantly checked? ))))

ZS: the alglieb had a higher precision generator.... but again the question is whether the example from the help works correctly

 
Igor Makanu:

I know how to solve this problem - I'll take the time in WinAPI, but is this another feature that needs to be checked all the time? ))))

If passes are not lightning fast and you need it without DLL, you can do that.

MathSrand((uint)GetTimeLocal()); // https://www.mql5.com/ru/forum/170952/page105#comment_9044250

How it affects SSD I don't know. I use RAMDrive.

 
fxsaber:

If passes are not lightning fast and no DLL is needed, you can do it this way.

I don't know how this affects the SSD. I use RAMDrive.

I checked it by outputting to OnTester()

Picture as above

the whole point here is to be sure that if you optionally load NS via GA tester, it's not a guarantee that all local processor cores won't work with the same initial configuration of NS weights - this will spoil results of training, imho

 

Sorry to put a pocket in here, but really need to figure out what to do.

Forum on trading, automated trading systems and trading strategy testing

Error downloading indicators from higher TFs (D1 for example)

Vladislav Andruschenko, 2020.02.27 18:42

Here is the gist:

I have noticed at the beginning of this error and interferences when accessing higher TF D1 and W1 from the EA which I have installed on M5 for example (I don't care which TF).

Now I found the same error in the strategy tester of another EA (which does not intersect with the previous one)

My Actions:

  1. The Expert Advisor checks complex signals of 3 indicators (2 indicators + 3 TF)
  2. If these indicators and TF take data from any TF up to D1 (everything below)! Then there are no errors! And the test with and without visualization is the same!
  3. But if we select any indicator with TF D1 and above, then the results are different (Visualization and without visualization).