how to create chart offline with my custom closes?

 

hello 

i want to create my offline chart with my closes and data.

void OnTick()
  {
  MqlRates rate[];
  MqlTick tick[];
  for(int g=0;g<siz;g++){
  ArrayResize(rate,g+1);
  rate[g].close=candles_close[g];
  rate[g].high=candles_high[g];
  rate[g].low=candles_low[g];
  rate[g].open=candles_open[g];
  rate[g].time=TimeCurrent();
  rate[g].spread=0;
  rate[g].tick_volume=0;
  rate[g].real_volume=0;
  }
  CopyTicks("XAUUSD",tick,COPY_TICKS_ALL,0,1);
  CustomRatesUpdate("me",rate);
  CustomTicksAdd("me",tick);
  }

i know my code is very bad . but i ask you to help me to modify it.

i want to show my data on offline chart . my data is in a few text file . i load and save it in 4 arrays.

please help my to complete my code (my expert show candles and update them automatically when ontick() is called).

 
Amini1382: i want to create my offline chart with my closes and data.

So do it. Your posted code doesn't do it.

 
William Roeder #:

So do it. Your posted code doesn't do it.

thank you for your answer 

i could make it with your help !

 https://charts.mql5.com/33/779/me-m1-alpari.png

this is my offline chart .

i just want to say thank you very much.

Reason: