# How to get open prices of 10 bars which was opened at GMT 10 o'clock - page 2

Marco vd Heijden:
thank you very much!

Rezo_chitanava:
thank you very much!

next time:

Marco vd Heijden:

Marco vd Heijden:

next time:

it does not redraw. i want to redraw lines when the circle ends.

look at the code. where i have a mistake?

//+------------------------------------------------------------------+

#property strict

#property indicator_chart_window

extern int Quartile = 10;

extern int TimeH = 10;

string obj_name="R.T. Lines : ";

long current_chart_id=ChartID();

//+------------------------------------------------------------------+

//| Custom indicator initialization function                         |

//+------------------------------------------------------------------+

int OnInit()

{

//--- indicator buffers mapping

//---

return(INIT_SUCCEEDED);

}

//+------------------------------------------------------------------+

//| Custom indicator deinitialization function                       |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)

{

//---

ObjectDelete(current_chart_id, obj_name);

//---

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function                              |

//+------------------------------------------------------------------+

int OnCalculate(const int rates_total,

const int prev_calculated,

const datetime &time[],

const double &open[],

const double &high[],

const double &low[],

const double &close[],

const long &tick_volume[],

const long &volume[],

{

//---

int bars=Quartile*24;

for(int i=0;i<bars;i++)

{

if(TimeHour(iTime(Symbol(),PERIOD_H1,i))==TimeH)

{

WindowRedraw();

ObjectCreate(current_chart_id, obj_name + IntegerToString(i),OBJ_VLINE,0,iTime(Symbol(),PERIOD_H1,i),0);

}

if(i == bars-1)

{

WindowRedraw();

ObjectMove(current_chart_id, obj_name + IntegerToString(i), 1, iTime(Symbol(),PERIOD_H1,i), 0);

}

}

//--- return value of prev_calculated for next call

return(rates_total);

}

//+------------------------------------------------------------------+

Rezo_chitanava:

it does not redraw. i want to redraw lines when the circle ends.

I am sorry i do not know where or when the circle ends.

In fact i can not see any circle at all.

I do not know what you mean by circle.

Also i have no idea about what you are trying to accomplish.

[Deleted]
Marco vd Heijden:

I am sorry i do not know where or when the circle ends.

In fact i can not see any circle at all.

I do not know what you mean by circle.

Also i have no idea about what you are trying to accomplish.

:))))))))))))))))))))))))))))))))

Volli:

:))))))))))))))))))))))))))))))))

I know thats why i ask them to be specific.

Marco vd Heijden:
I know thats why i ask them to be specific.
sorry. i mean for loop. for example i use 10 lines. this means i need 24*10(quartiles) bar counts. then it sets lines. but when there is new 10(TimeH) o'clock it sets 11th line. so i need to delete the oldest line.

you can just use

```ObjectsDeleteAll();
```

And then simply draw a new 10 line structure so that it's up to date.

Just compare the last 10hr bar with new 10hr bar time and whenever they differ create new lines, then overwrite the bar time with the new value and wait for the next new 10hr bar.

Marco vd Heijden:

you can just use

And then simply draw a new 10 line structure so that it's up to date.

Just compare the last 10hr bar with new 10hr bar time and whenever they differ create new lines, then overwrite the bar time with the new value and wait for the next new 10hr bar.

Where end how use ObjectDeleteAll()? look at code and if you can please help and fix it.

int bars=10*24;

for(int i=0;i<=bars;i++)

{

if(TimeHour(iTime(Symbol(),PERIOD_H1,i))==10)

{

ObjectCreate(current_chart_id, obj_name + IntegerToString(i),OBJ_VLINE,0,iTime(Symbol(),PERIOD_H1,i),0);

}

if(i == bars-1)

{

ObjectMove(current_chart_id, obj_name + IntegerToString(i), 1, iTime(Symbol(),PERIOD_H1,i), 0);

}

}

Reason:
{"ft_lang_label":"__label__en","ft_lang_prob":0.66792166,"math_prob":0.931918,"size":4095,"snap":"2023-14-2023-23","text_gpt3_token_len":939,"char_repetition_ratio":0.21192862,"word_repetition_ratio":0.4618182,"special_character_ratio":0.3912088,"punctuation_ratio":0.14887218,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98745745,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-06T06:23:59Z\",\"WARC-Record-ID\":\"<urn:uuid:4ccb3532-5d12-4cb3-8b47-0373f733f420>\",\"Content-Length\":\"76780\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1cdc1b98-407a-436e-8ffa-657f858f0064>\",\"WARC-Concurrent-To\":\"<urn:uuid:0e56b14e-1c12-4ce8-b7f2-6673b4253805>\",\"WARC-IP-Address\":\"142.215.208.239\",\"WARC-Target-URI\":\"https://www.mql5.com/en/forum/91974/page2\",\"WARC-Payload-Digest\":\"sha1:5NACSNAIOPISFXRUTAHVPWQIWTWIUYUQ\",\"WARC-Block-Digest\":\"sha1:ONIMIY4CJD4VBPPXPSPOSS5BXSFDIUZU\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224652235.2_warc_CC-MAIN-20230606045924-20230606075924-00038.warc.gz\"}"}