I try write the code with limitation of one trade per minute, but it doesn't work (perhaps problem is with logic). I tried many versions with break, Sleep(). Have anyone any suggestions?
thank you.
datetime mt=TimeCurrent();
datetime mtoop=mt-PERIOD_M1*60;
Print("mtoop==",mtoop); // current time minus 1 minute, worksfor (int j=OrdersTotal()-1;j>=0;j--)
{
if (OrdersSelect(j,SELECT_BY_POS,MODE_HISTORY)
if (OrderSymbol()==Symbol())
{
datetime z=OrderOpenTime();
if (mtoop <z && z<mt) break; // Sleep(60000) doesn't work
}
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi,
I try write the code with limitation of one trade per minute, but it doesn't work (perhaps problem is with logic). I tried many versions with break, Sleep(). Have anyone any suggestions?
thank you.