Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 364
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Is it possible to make a table in MT4 with a structure like in Excel (+ and - collapses and unfolds the data)? If so, where can I read about it?
Hi all! I'm just learning the codes. There is an error, I can't figure out how to fix it.
int CountTrades(int type, int magic)
{
int count=0;
for(int i=OrdersTotal()-1;i>=0;i-)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderSymbol()==Symbol() && (OrderType()==type||type==-1) &&
(OrderMagicNumber()==magic||magic==-1))
count++;
}
}
return (count);
I've highlighted what it misses.
The errors are as follows:
"-" operand expected
")" - unexpected token
"i" - undeclared identifier
It's like he doesn't like that I put minus after i in the first error. Maybe I should hyphenate it somehow?
I did it all letter by letter with the tutorial - but the code does not compile.
I need your help.
Hi all! I'm just learning the codes. There's a bug, can't figure out how to fix it.
Two minuses and no brackets to close the function.
Thank you very much! All fixed! It's working!
I had to compare the two datetime by hours, I did it this way:
It worked, but maybe this is not the most correct way? What do the programmers have to say?
I had to compare the two datetime by hours, I did it this way:
It worked, but maybe this is not the most correct way? What do the programmers have to say?
Maybe I didn't explain it correctly, but you need to find two dates to the exact hour (minutes and seconds are not important). You only have a comparison by hours.
Maybe I didn't explain it correctly, but you need to find two dates to the exact hour (minutes and seconds are not important).
you need to find dates, or compare the hour of 2 dates ?
find dates, or compare the hour of 2 dates ?
You need to find dates to the exact hour (minutes and seconds are not important).
you have to find the dates, or compare the hour of 2 dates ?
Would CopyTime work better?
This way.
Translating time into a string and comparing it is not a good option.