Question about periods

 
Is there a way to capture the high, low, open or close of a period, at the last second?
 
Yellowbeard wrote >>
Is there a way to capture the high, low, open or close of a period, at the last second?

Go through that page : https://docs.mql4.com/predefined/variables/close

 
Jacques366 wrote >>

Go through that page : https://docs.mql4.com/predefined/variables/close

int Dt = (Time[4]-Time[5])-MathMod(CurTime(),Time[4]-Time[5]);
int Dx = Seconds();

text=(Dt);
Write("MP14105", Side, MP_X+300, MP_Y+90, text, 11, "Tahoma", Lime);

text=(Dx);
Write("MP14107", Side, MP_X+320, MP_Y+90, text, 11, "Tahoma", Red);


if (Dx <= 1 && CL == LL)


{ SignalSymbol=UpSymbol; SignalColor=Arrow_Up;}


if (Dx <= 1 && OP == HH)

{ SignalSymbol=DnSymbol; SignalColor=Arrow_Dn; }


Write("MP14106", Side, MP_X+270, MP_Y+20, SignalSymbol, 25, "Wingdings", SignalColor);

This counts down the seconds remaining in a one minute period. As well as seconds, elapsed. I'm trying to determine Buy candle or Sell candle at the last second. Unable to get true state for the if statements because counter rarely reaches 0. Counter counts as 59, 57, 48, 46, 23, 22, 21, 7, 3, 55 etc. instead of 59, 58, 57, 56, 55, 54. I need some other point that I can reference from to determine the beginning and/or end of a period.

 

It is not surprising, you are receiving data every 'tick' and not every second. That means 'ticks' are the smallest time sequence in your entry data. Considering that, if you refer to a smaller time scale, such as seconds, you will have a margin error to manage. As far as I know MT4 and as far as I understand your request, I think you won't be able to catch a precise second every period simply because the data you are working with do not allow such a precision. Will see if somebody else will have a divergent point of view and I apologize if I misunderstood your question.

Reason: