Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 365

 
Nauris Zukas:

you need to find dates to the exact hour (minutes and seconds are not important).


try this


if(RoundTime(MyLastNewsTime[i])!=RoundTime(MyLastNewsTime1[i]))
 {
 }
//---
datetime RoundTime(datetime intime)
{
return(intime-TimeMinute(intime)*60-TimeSeconds(intime));
}
//---
 
Alexey Viktorov:

Would CopyTime be a better option?

Such variant.

Translating time into a string and comparing it is not a good option.

Yes, that's what I understood, that's why I raised the question. Thank you.

 
Nikolay Ivanov:

Try this.


Thank you.

 

Hello, I've searched a lot on the net, but so far I haven't found anything useful. I am interested in an algorithm for calculating volatility, but not a simple arithmetic mean, but with the exception of sudden jumps (during news releases, etc.), if someone has already written such an algorithm, I would not want to re-invent the wheel.

 
Falx:

Hi all! I'm just learning the codes. There is an error, can't figure out how to fix it.

.....

for(int i=OrdersTotal()-1;i>=0;i-)

.....

It should be like this :

for(int i=OrdersTotal()-1;i>=0;i--)
 

Hi all.

Teach me how to write that after opening an order for a given candlestick, no new orders will open again.

 
msl271170:

Hi all.

Teach me how to write that after opening an order for a given candlestick, no new orders will open again.


Check by date of opening of order and candlestick...

 
Aleksey Vyazmikin:

Check by order and candlestick opening date...

I don't really understand. If the candlestick is on hourly timeframe, how by date?

And a code example, if you can...

 
msl271170:
I do not really understand. If the candlestick is on hourly timeframe, how by date?

And a code example, if you can...


And what's the problem with knowing the date and time of the bar, for example iTime function look it up.

 
Aleksey Vyazmikin:

What's the problem with finding out the date and time of a bar, for example the iTime function.


Thanks, I think I've figured it out.

And how to run the debugger on historical data?

Reason: