strategy tester

 
Hello
I wrote the code in the "OnBookEvent" function to reach the depth of the market. This code has no problem when executed as a script and returns the requested parameter as an alert. But when I run the same code as an expert advisor in MetaTrader environment, it does not print any data for me and one of its errors is:
 debug version of 'DOM.ex5', please recompile it.

.......
What is the reason for this error?
//+------------------------------------------------------------------+
//|                                                          DOM.mq5 |
//|                                  Copyright 2021, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   MarketBookAdd("Si-9.15");
//---
   return(INIT_SUCCEEDED);
  }

void OnDeinit(const int reason)
  {
//---
  MarketBookRelease("Si-9.15"); 
  }
  
  
  void OnBookEvent(const string &symbol)
  {

   MqlBookInfo book[];
   MarketBookGet(_Symbol, book);
   if(ArraySize(book) == 0)
   {
      printf("Failed load market book price. Reason: " + (string)GetLastError());
      return;
   }
   string line = "Price: " + DoubleToString(book[0].price, Digits()) + "; ";
   line += "Volume: " + (string)book[0].volume + "; ";
   line += "Type: " + EnumToString(book[0].type);
   printf(line);
 
  }
void OnTick()
  {
//---
   
  }
//+------------------------------------------------------------------+
 
yasser.danesh :
***
 debug version of 'DOM.ex5', please recompile it.
***

The error description gives you a clear order: "This is a DEBUGGING version, please RECOMPILATE the code."

Why are you making such a mistake: first, you ran your code in the "debugging on real data" mode ( debugging on real data) or in the "debugging on history data" ( debugging on history data). These two modes create a special "debug" version of your code. You just need to compile ( Complile) Of your code.