Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1082

 
Good afternoon all. Can you advise or show me where to find out how to set Buy Stop and Sell Stop orders in an EA at the end of the day, for example at 23:59. I don't find much information on the time functions.
 
wishmast I placed orders at 23:59, for example

if((TimeHour(TimeCurrent())==RequiredHour) &&(TimeMinute(TimeCurrent())==RequiredMinute) &&(OrdersNone)) SetOrders;

Where is the profit here?

 

Good afternoon.

In the indicator window, I want to put the time in the places where the bar graph passes the red line (marked by red arrows). What function can do it? SetIndexStyle only offers lines and histograms.

 
abeiks:

Good afternoon.

In the indicator window, I want to put the time in the places where the bar graph passes the red line (marked by red arrows). What function can do it? SetIndexStyle only offers lines and histograms.

You can do it with text objects.
 
abeiks:

Good afternoon.

In the indicator window, I want to put the time in the places where the bar graph passes the red line (marked by red arrows). What function can do it? SetIndexStyle only offers lines and histograms.

ObjectCreate(name, OBJ_LABEL, Window, Time, ...) The names must be different. Take Time as a name. Where's the profit here?
 
evillive:
With text objects you can.
Thank you.
 
LRA:
ObjectCreate(name, OBJ_LABEL, Window, Time, ...) The names must be different. Take Time as name. Where is the profit here?
Thank you.
 

Good afternoon, gentlemen.

Question on arrays. How to find the largest value of the indicator on the required number of last bars of the chart, and not the first?

   //--- создадим массив 
   double array[]; 
   int size=772; 
   ArrayResize(array,size); 
   //---  заполним его значениями индикатора 
   for(int i=0;i<size;i++) 
     { 
      array[i]=iATR(NULL,0,14,i);
     }
   //--- найдем позицию максимального элемента в массиве 
   int max_position=ArrayMaximum(array,772,0); 
   //--- теперь получим само максимальное значение в массиве 
   double max=array[max_position];

It has been discussed many times (I cannot find it), but I have rarely used arrays.

Can you advise how to solve the problem with indexing, perhaps I can do it more elegantly with ArrayMaximum(array)?

If somewhere elementary mistake, sorry, I am self-taught.

 
Craft:

Good afternoon, gentlemen.

Question on arrays. How to find the largest value of the indicator on the required number of last bars of the chart, and not the first?

It has been discussed many times (I cannot find it), but I have rarely used arrays.

Can you advise how to solve the problem with indexing, perhaps I can do it more elegantly with ArrayMaximum(array)?

If there is an elementary error somewhere, I'm sorry, I am self-taught.

If you search the whole array, in ArrayMaximum() only the array's name is enough.

int max_position=ArrayMaximum(array); 
 
What if you need to find the highest value in a given number of last bars?