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!
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)
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).
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?
staticbool 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);
}
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]))) //вернет бар открытия вчерашнего дня на любом текущем тф
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)
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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.
Read
first set the size of the array
buf[2]; .
assign
buf[0]=x1; buf[1]=x2;
Read it will take you 2 min.
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)
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.
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?
ex4 is not viewable, need mq4
ok. sorry...
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
The picture is probably easier to explain.
ok. sorry...
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)