[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 410

 
costy_:

Well, where is the indicator?! (guessing by coffee grounds Tel. https://www.mql5.comhttps://www.mql5.com/ru/)

Correction...

The problem is - the indicator doesn't redraw with the appearance of a new bar.

The indicator code is in the attached file. I cannot place it via src (the code is not too big).

Thanks in advance for the help.

 
People, please tell me how to describe the following situation in an elegant way. Suppose we have just formed a bar on a high TF (for example iHigh[NULL,1440,1]). How to describe the first bar in the code on a lower TF while iHigh[NULL,1440,0] is forming?) ? I can only think of cumbersome structures. Thank you!
 
costy_:

Read

first set the size of the array

buf[2]; .

assign

buf[0]=x1; buf[1]=x2;

Read it will take you 2 min.

Thank you. Already read it, I guess I didn't pay much attention.
 
001:
Could you tell us how to describe the situation in the following way? Suppose we have only a bar formed on a high TF (for example iHigh[NULL,1440,1]). How to describe the first bar in the code on a lower TF while iHigh[NULL,1440,0] is forming?) ? I can only think of cumbersome structures. Thank you!

i.e., do you know if a new daily candle has opened on a lower timeframe?

Or boundaries in bars of 1 day candle on a low (not 0)

 
LOA:

Correction...

The problem is that the indicator does not redraw with the appearance of a new bar.

The indicator code is in the attached file. I did not manage to place it via src (the code seems to be small).

I am very thankful for the help.

ex4 is not viewable, need mq4
 
costy_:

i.e., do you know if a new daily candle has opened on a lower timeframe?

Or boundaries in bars of a 1-day candle on a low (not 0)


When a new candle opened in the high TF, return the value of a certain candle in a low TF, but within the limits of the candle, which is formed (it is now on the high 0-th), in the high TF. I.e. while there is still a 0 candle on the high TF, to return the value of a certain candle on the low TF.

In my case we need to know that this candle on (M1 for example) closed above the high on D1 (for example).

 

How do I make:

if Condition1 is true, then don't check it on every tick, and on subsequent ticks check Condition2 also and then Condition3 also until we declare all flags to be false?

static bool Val_max, Cl_dn, Val_min; //static or global
                                        |
//+------------------------------------------------------------------+
int start()
  {
   int j;
   double bid;                                         
   bid=Bid;                                    // Текущая цена продажи
   string
   Symb=Symbol();                               // Название фин.инстр.
double Value_max=1.0000;
double Value_min=0.9980;
double Open_1=Open[1];
double Close_1=Close[1];
//----

//--------------------------------------------------------------- 4 --

double Val=iCustom(NULL, 0, "Название Польз. Индикатора",0,0);   // Присваиваем пер. Val значение польз. индикатора
if (Условие1)
{
 Val_max=true;                  // 
 Alert("Значение инд. >= Value_max (исп. 1-е усл.)");
}
if (Условие2)
{
 Cl_dn=true;
 Alert("1 бар закрылся падением (исп. 2-е усл.)");
}
if (Условие3 && Cl_dn==true)
{
 Val_min=true;
 Alert("Значение инд. <= Value_min (исп. 3-е усл.)");
}
if (Val_max==true && Cl_dn==true && Val_min==true)
  {
   for (j = 0; j < OrdersTotal(); j++)
    {
     OrderSelect(j, SELECT_BY_POS, MODE_TRADES);
     if (OrderSymbol() == Symbol())
      {
      if (OrderType() == OP_SELL) return(0);
      }
    }
   
   OrderSend(Symbol(),OP_SELL,0.1,NormalizeDouble(Bid,Digits),2,Bid+400*Point,Bid-400*Point,"",3,Red);  // Открытие SELL
   Val_max=false; Cl_dn=false; Val_min=false;
  }

//----
   return(0);
  }
 
costy_:
ex4 is not viewable, need mq4

ok. sorry...
 
001:


When a new candle opened on the high TF, return the value of a certain candle on the low TF, but within the candle being formed (it is still 0 on the high), on the high TF. I.e., while there is still a 0 candle on the high TF, to return the value of a certain candle on the low TF.

In my particular case, I need to know that this candle on (M1 for example) closed above the high on D1 (for example).

Still do not understand

iBarShift(0,0,iTime(0,1440,iBarShift(0,1440,Time[0]))) //вернет бар открытия текущего дня на любом текущем тф
iBarShift(0,0,iTime(0,1440,1+iBarShift(0,1440,Time[0]))) //вернет бар открытия вчерашнего дня на любом текущем тф

The picture is probably easier to explain.

 
LOA:

ok. sorry...
iCustom (NULL,0,"ME_Proboy_F5_For_EX",0,i+1)

it reads the data of the bar that has already established (previous) i+1 remove. But the creator's algorithm will be broken (he knows best, I also work on open and generated data +1)

Reason: