on testing to see if the following ea draws lines :

//+------------------------------------------------------------------+
//|                                            HighLowBreakoutEA.mq5 |
//|                                  Copyright 2025, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"

//+------------------------------------------------------------------+
//| Include                                                          |
//+------------------------------------------------------------------+
#include <Trade\Trade.mqh>


//+------------------------------------------------------------------+
//| Inputs                                                           |
//+------------------------------------------------------------------+
static input long    InpMagicnumber = 546872;   // magicnumber
static input double  InpLots  = 0.01;           // lot size
input int            InpBars = 20;              // bars to get high/low     
input int            InpStopLoss = 100;         // stop loss in points (0=off)
input int            InpTakeProfit = 0;         // take profit in points (0=off)


//+------------------------------------------------------------------+
//| Global variables                                                 |
//+------------------------------------------------------------------+
double high =0;   // highest price of the last N bars
double low=0;     // lowest price of the last N bars
MqlTick currentTick, previousTick;
CTrade trade;


//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   //check for user input
   if(!CheckInputs()){return INIT_PARAMETERS_INCORRECT;}
   
   // set magicnumber
   trade.SetExpertMagicNumber(InpMagicnumber);
   
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   // get tixk
   previousTick = currentTick;
   if(!SymbolInfoTick(_Symbol,currentTick)){Print("Failed to get current tick"); return;}

   //count open postions
   int cntBuy,cntSell;
   if(!CountOpenPositions(cntBuy,cntSell)){return;}
   
   //check buy positions
   if(cntBuy==0 && high!=0 && previousTick.ask<high && currentTick.ask>=high)
     {
      Print("open buy position");
     }
     
   //check sell positions
   if(cntSell==0 && low!=0 && previousTick.bid>low && currentTick.bid<=low)
     {
      Print("open sell position");
     }
     
     
   // calculate high/low
   high = iHigh(_Symbol,PERIOD_CURRENT,iHighest(_Symbol,PERIOD_CURRENT,MODE_HIGH,InpBars,0));
   high = iLow(_Symbol,PERIOD_CURRENT,iLowest(_Symbol,PERIOD_CURRENT,MODE_LOW,InpBars,0));
   DrawObjects();
     
  }
  
  
//+------------------------------------------------------------------+
//| Functions                                                        |
//+------------------------------------------------------------------+

// check user input
bool CheckInputs()
   {
   if(InpMagicnumber<=0)
      {
      Alert("Wrong Inputs: Magicnumber <=0");
      return false;
      }
   
   if(InpLots<=0)
      {
      Alert("Wrong Inputs: Lot Size <=0");
      return false;
      }
   
   if(InpBars<=0)
      {
      Alert("Wrong Inputs: Bars <=0");
      return false;
      }

   if(InpStopLoss<=0)
      {
      Alert("Wrong Inputs: Stop loss <=0");
      return false;
      }

   if(InpTakeProfit<=0)
      {
      Alert("Wrong Inputs: Take Profit <=0");
      return false;
      }
         
   return true;
   
   }

//Draw high an low lines on the chart
void DrawObjects()
   {
   datetime time = iTime(_Symbol,PERIOD_CURRENT,InpBars);
   
   //high
   ObjectDelete(NULL,"high");
   ObjectCreate(NULL,"high",OBJ_TREND,0,time,high,TimeCurrent(),high);
   ObjectSetInteger(NULL,"high",OBJPROP_WIDTH,2);
   ObjectSetInteger(NULL,"high",OBJPROP_COLOR,clrYellow);
   
   //low
   ObjectDelete(NULL,"low");
   ObjectCreate(NULL,"low",OBJ_TREND,0,time,low,TimeCurrent(),low);
   ObjectSetInteger(NULL,"low",OBJPROP_WIDTH,2);
   ObjectSetInteger(NULL,"low",OBJPROP_COLOR,clrYellow);
   
   }




// count open positions
bool CountOpenPositions(int &cntBuy, int &cntSell)
{
   cntBuy = 0;
   cntSell = 0;
   int total = PositionsTotal();
   for(int i=total-1; i>=0; i--)
   {
      ulong ticket = PositionGetTicket(i);
      if(ticket<=0){Print("Failed to get position ticket");return false;}
      if(!PositionSelectByTicket(ticket)){Print("Failed to select position");return false;}
      long magic;
      if(!PositionGetInteger(POSITION_MAGIC,magic)){Print("Failed to get position magicnumber");return false;}
      if(magic==InpMagicnumber)
      {
         long type;
         if(!PositionGetInteger(POSITION_TYPE,type)){Print("Failed to get position type");return false;}
         if(type==POSITION_TYPE_BUY){cntBuy++;}
         if(type==POSITION_TYPE_SELL){cntSell++;}
         
      }      
      
   }
   return true;
}


//normalize price
bool NormalizePrice(double &price)
   {
   double tickSize=0;
   if(!SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_SIZE,tickSize))
      {
      Print("Failed to get tick size");
      return false;
      }
      
    price = NormalizeDouble(MathRound(price/tickSize)*tickSize,_Digits);
    return true;
   }

// close positons
bool closePositions(int all_buy_sell)
   {
   int total = PositionsTotal();
   for(int i=total-1; 1>=0; i--)
      {
      ulong ticket =PositionGetTicket(i);
      if(ticket<=0){Print("Failed to get position tickect "); return false;}
      if(!PositionSelectByTicket(ticket)){Print("Failed to select postion"); return false;}
      long magic;
      if(!PositionGetInteger(POSITION_MAGIC,magic)){Print("Failed to get position magic number"); return false;}
      if(magic==InpMagicnumber)
        {
         long type;
         if(!PositionGetInteger(POSITION_TYPE,type)){Print("Failed to get position type"); return false;}
         if(all_buy_sell==1 && type==POSITION_TYPE_SELL){continue;}
         if(all_buy_sell==2 && type==POSITION_TYPE_BUY){continue;}
         trade.PositionClose(ticket);
         if(trade.ResultRetcode()!=TRADE_RETCODE_DONE)
           {
            Print("Failed to close position. ticket",
                    (string) ticket," result:",(string)trade.ResultRetcode(),":",trade.CheckResultRetcodeDescription());
                   
           }         
        }
      }
      
    return true;
   }


//+------------------------------------------------------------------+
//| Trade function                                                   |
//+------------------------------------------------------------------+
void OnTrade()
  {
//---
   
  }
//+------------------------------------------------------------------+


i get:

2025.07.22 01:38:12.824	MetaTester 5 started on 127.0.0.1:3001
2025.07.22 01:38:12.829	cloud network mode is off
2025.07.22 01:38:12.829	initialization finished
2025.07.22 01:38:13.100	login (build 5120)
2025.07.22 01:38:13.344	26040 bytes of account info loaded
2025.07.22 01:38:13.344	1478 bytes of tester parameters loaded
2025.07.22 01:38:13.344	2756 bytes of input parameters loaded
2025.07.22 01:38:13.346	2612 bytes of symbols list loaded (334 symbols)
2025.07.22 01:38:13.346	expert file added: Experts\HighLowBreakoutEA.ex5. 12021 bytes loaded
2025.07.22 01:38:13.430	2953 Mb available, 36 blocks set for ticks generating
2025.07.22 01:38:13.430	calculate profit in pips, initial deposit 100, leverage 1:100
2025.07.22 01:38:13.436	successfully initialized
2025.07.22 01:38:13.436	17 Kb of total initialization data received
2025.07.22 01:38:13.436	Intel Core i5-8350U  @ 1.70GHz, 7653 MB
2025.07.22 01:38:13.465	GBPJPY.Z: symbol to be synchronized
2025.07.22 01:38:13.466	GBPJPY.Z: symbol synchronized, 3720 bytes of symbol info received
2025.07.22 01:38:13.466	GBPJPY.Z: history synchronization started
2025.07.22 01:38:13.470	GBPJPY.Z: load 31 bytes of history data to synchronize in 0:00:00.002
2025.07.22 01:38:13.470	GBPJPY.Z: history synchronized from 2024.01.02 to 2025.07.18
2025.07.22 01:38:13.629	GBPJPY.Z,M1: history cache allocated for 572582 bars and contains 556124 bars from 2024.01.02 00:02 to 2025.06.30 23:58
2025.07.22 01:38:13.629	GBPJPY.Z,M1: history begins from 2024.01.02 00:02
2025.07.22 01:38:13.633	GBPJPY.Z,M1 (HFMarketsKE-Demo2): every tick generating
2025.07.22 01:38:13.633	testing with execution delay 138 milliseconds
2025.07.22 01:38:13.633	GBPJPY.Z,M1: testing of Experts\HighLowBreakoutEA.ex5 from 2025.07.01 00:00 to 2025.07.17 00:00 started with inputs:
2025.07.22 01:38:13.633	  InpMagicnumber=546872
2025.07.22 01:38:13.633	  InpLots=0.01
2025.07.22 01:38:13.633	  InpBars=20
2025.07.22 01:38:13.633	  InpStopLoss=100
2025.07.22 01:38:13.633	  InpTakeProfit=0
2025.07.22 01:38:13.651	2025.07.01 00:00:00   Alert: Wrong Inputs: Take Profit <=0
2025.07.22 01:38:13.651	tester stopped because OnInit reports incorrect input parameters
2025.07.22 01:38:13.651	log file "C:\Program Files\MetaTrader 5\Tester\Agent-127.0.0.1-3001\logs\20250722.log" written
2025.07.22 01:38:13.651	test Experts\HighLowBreakoutEA.ex5 on GBPJPY.Z,M1 thread finished
2025.07.22 01:38:13.667	prepare for shutdown
2025.07.22 01:38:13.667	shutdown finished