[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 74

 
ZZZEROXXX:


the consortium is intriguing ))

There are films about it ("The Spirit of the Times") and in books, new books are being prepared. It's starting to thaw if it doesn't come up with something new (Lenin also talked about the causes of the collapse, their essence). It is tentatively likely to disintegrate in 2032.
 
granit77:
That's how many years they've been tracking Petrov! And they got what they wanted!
)))))))))))))))))))) He is just one of the examples of eliminating the unwanted) And their methods are more like Sherlock Holmes, from the series "You Never Dreamed").
 

Hi all!

Does MQL4 allow getting Windows system time via WinAPI and to what precision?

An example would be desirable.

 
Lerans:

Hi all!

Does MQL4 allow getting Windows system time via WinAPI and to what precision?

An example would be useful.


to work with time there are functions in mql4:https://book.mql4.com/ru/functions/datetime

To work with dll, use: https://docs.mql4.com/ru/basis/preprosessor/import

Search the forum for examples by the name of the function you are interested in: https: //www.mql5.com/ru/search

 
IgorM:


to work with time there are functions in mql4:https://book.mql4.com/ru/functions/datetime

to work with dll: https://docs.mql4.com/ru/basis/preprosessor/import

examples by searching the forum for the name of the function of interest: https: //www.mql5.com/ru/search


Thank you! That's understandable. I didn't want to dig through the WinAPI. I was hoping to get a ready-made solution...

You need time accuracy better than 1 sec.

 
IgorM:


to work with time there are f-functions in mql4:https://book.mql4.com/ru/functions/datetime

to work with dll: https://docs.mql4.com/ru/basis/preprosessor/import

examples by searching the forum for the name of the function of interest: https: //www.mql5.com/ru/search


Found it.

Thank you!!!

 
volshebnik:
But it's not real and is hardly of any value.

You don't think so.
 
volshebnik:
There are films about him indirectly ("The Spirit of the Times") and in books, new books are being prepared. It is beginning to thaw if it does not come up with something new (Lenin also talked about the causes of the collapse, their essence). It is tentatively likely to disintegrate in 2032.

don't take the zeitgeist seriously
 
Lerans:

You need a time accuracy of better than 1 second.

formulate your question that way, then https://docs.mql4.com/ru/common/GetTickCount
 

Please advise on the function to close all orders

void Closeallorders()
{
int total;
Print("CloseAll");
total=OrdersTotal();
Print("total "+total);
for(int i=0;i<total;i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) { Print("break "+GetLastError()); break;}
if(OrderMagicNumber()!=MAGICMA || OrderSymbol()!=Symbol()) continue;
RefreshRates();
if (OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),Bid,3,White);
if (OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),Ask,3,White);
Print("close all error="+GetLastError());
}
}

why not all orders are closed. yes - there are errors 138 and 129. but sometimes in this line as well -

if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) { Print("break "+GetLastError()); break;}

The programmer breaks, but the error code is 0. - Why does it happen?

What else can be fixed apart from looping until all requests are killed completely?

Reason: