Well actually only removed the algorithms for selecting and determining the right item.
Didn't you miss that after the first recalculation (on the first tick after loading the indicator), the next one will happen when the 1st candle is 8 o'clock?
if (TimeHour(Time[1]) == 8 && !check)
check = true;
That's what I need. Once a day at 8 o'clock it draws. But when I put an indicator, did something there, closed MT with an indicator, the next day I open, when 8 o'clock bar has already passed, the indicator still stays on the old 8 o'clock bar, until I reload it or change the period. Although it has to find the one that has passed, as I told it to do in the loop. It needs this condition so that it draws a new one when the indy is open to the 8 o'clock bar.
Solree: That's what I need. Once a day at 8 o'clock it draws. But when I put an indicator, did something there, closed MT with an indicator, the next day I open, when 8 o'clock bar has already passed, the indicator still remains on the old 8 o'clock bar, until I reload it or change period. Although it has to find the one that has passed, as I told it to do in the loop. It needs this condition so that it draws a new one when the indy is open to the 8 o'clock bar.
After the line:
{//Тут y будет не корректным, когда запускаешь МТ с уже повешенным индюком
Add
Print("y=",y);
Run the test in visualisation mode (i.e. you can test some empty EA and throw the indicator onto the chart with your hands) and show what the log shows.
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, that's it then:
Well actually only removed the algorithms for selecting and determining the right item.
Didn't you miss that after the first recalculation (on the first tick after loading the indicator), the next one will happen when the 1st candle is 8 o'clock?
That's what I need. Once a day at 8 o'clock it draws. But when I put an indicator, did something there, closed MT with an indicator, the next day I open, when 8 o'clock bar has already passed, the indicator still remains on the old 8 o'clock bar, until I reload it or change period. Although it has to find the one that has passed, as I told it to do in the loop. It needs this condition so that it draws a new one when the indy is open to the 8 o'clock bar.
After the line:
{//Тут y будет не корректным, когда запускаешь МТ с уже повешенным индюкомAdd
Run the test in visualisation mode (i.e. you can test some empty EA and throw the indicator onto the chart with your hands) and show what the log shows.Why. When I run MT, the code is executed once. It locates the bar in the history and draws from it.
It is understandable.
You are saying that the indicator does not re-run. And it "re-executes" when the 1st bar is at eight o'clock.
This is the situation that needs to be modelled.
Although y should be 13 by now. Why is it stuck in time?
2011.10.18 21:01:17 ResistDay EURUSD,H1: y=12
Although y should be 13 by now. Why is it stuck in time?
and it is supposed to be 13? No missing bars?