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:

explain a bit more about your goals.

 
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[],

                const int &spread[])

{

//---

   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.

 
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.

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

Last mounth I had 82% customers that explains tasks like him. When I asked questions about task they thought that I am trolling them:))))))))))))

 
Volli:

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

Last mounth I had 82% customers that explains tasks like him. When I asked questions about task they thought that I am trolling them:))))))))))))

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: