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 need some help with this code, After I placed BuyStop order the following is executed
void OnTrade()
{
int o_total = OrdersTotal();
for (int j=0; j<o_total; j++)
if (myorder.Select(OrderGetTicket(j)))
if (myorder.Type() == ORDER_TYPE_BUY_STOP)
signal_time=myorder.TimeSetup();
Print (TimeToString(signal_time,TIME_DATE|TIME_MINUTES));
}
signal_time is defined as global datetime, print gives WRONG_VALUE (which is assign on Init());
Works if I skip part
if (myorder.Type() ==ORDER_TYPE_BUY_STOP)
If I try to print value of myorder.Type() is 0, where ORDER_TYPE_BUY_STOP is 4;
Is't this has something to do with time, when I send query (onTrade) ?