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

 
Solree:

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?

    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.
 
Has my question gone into oblivion...?
 
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.
 
I'll throw in the results in 10 minutes (when the new bar arrives). Right now y = 12.
 
With this approach, the result will be when your DC is at 9:00
 
Why. When I run MT, the code is executed once. It is in the history bar and draws from it.
 
Solree:
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.

 
2011.10.18 21:01:17 ResistDay EURUSD,H1: y=12
Although y should be 13 by now. Why is it stuck in time?
 
Solree:
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?
Reason: