How to work with TimeCurrent in strategy tester

Hello

I have a simple mql code, I want to get current price and price of 20 seconds later in stratgy tester, Here is my code:

int _time_waiting=0;
 int _PauseTime=TimeCurrent();
void OnTick()
  {
//---

double current_bid = SymbolInfoDouble(_Symbol, SYMBOL_BID);
double current_ask = SymbolInfoDouble(_Symbol, SYMBOL_ASK); 

Print(current_ask);
                                         
 _time_waiting = _PauseTime + 20;  // wait for 20 sec
                     
  if ( TimeCurrent() >= _time_waiting )    // wait until 20 seconds have passed
   {
    double current_ask_new = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
Print(current_ask_new);
   }

But in strategy tester it just show the current price not the 20 later price, Do you have any idea?

Do you work with “every tick” mode?
and tics can come with a larger interval than every 20 sec.

not any ideal solutions, but you should get the price;

void OnTick() {
   double current_ask = SymbolInfoDouble(_Symbol, SYMBOL_ASK); 
   Print("Current ask : ",current_ask);
   
   Sleep(20*1000); // Sleep 20 seconds
   RefreshRates();
   double current_ask_new = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
   Print("New ask : ",current_ask_new);
   Print("End of tick loops");
}