EA to open offline m1 chart

 

my ea opens regular chart i want to open an offline m1 chart only , but its not working , how can i achieve to open only offline chart , i have lot of offline chart data 

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{
   // Open a chart with the current symbol and M1 timeframe 
   long chart_id = ChartOpen(Symbol(), PERIOD_M1);

  
      
   {
      // Print an error message if the chart failed to open
      Print("Failed to open M1 chart.");
   }
   
   // Stop the EA since it's not needed further
   return INIT_SUCCEEDED;
}
//+------------------------------------------------------------------+
 

On MetaTrader 4, the Offline Charts are usually on a different non-standard time-frame (not the original).

See which time-frame you assigned to the Offline Chart and use that instead.

 
i want to open m1 offline explicitly   , not m3 or m4 etc., 
 
sere8 #: i want to open m1 offline explicitly   , not m3 or m4 etc., 

The only way to generate Offline Charts and place them at M1, is by giving it a different non-standard symbol name instead of the original.

You will never be able to generate a Offline Chart with both the original symbol name and the standard time-frames at the same time.

So you have to choose, either you generate to a non-standard time-frame (the most common method) or generate to a non-standard symbol name (less common because it has other issues).