Errors, bugs, questions - page 2840

 
Sergey Dzyublik:

You can explicitly call a function from a base class:

If and when corrected

template<typename T>
class A {
public:
        void f() {}
};
void OnStart()
{
        A<int> a;
        a.A<int>::f(); //Error: 'A' - undeclared identifier
}

it can of course also be called explicitly in the general case

 
A100:

And how do you propose to write the 3rd version of g_cast to MQL?

You can do it like this:

A(this).f();
 

Build 2584
Error not fixed.

When firstrunning the service,WebRequest returns 200.
When restarting the service PCM, WebRequest returns error 1001.
Removing the service and running it again, it repeats.

#property service
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"


//+------------------------------------------------------------------+
//| Service program start function                                   |
//+------------------------------------------------------------------+
void OnStart()
{
   string headers = "";
   char   request[];
   
   char   result[];
   string resHeader = "";
   
   string url = "https://httpbin.org/get";

   ResetLastError();
   
   int res = WebRequest("GET", url,  headers, 5000, request, result,  resHeader);
      
   if(res == -1)
   {
      Print("Ошибка в WebRequest. Код ошибки: ", GetLastError());
      MessageBox("Необходимо добавить адрес '" + url + "' в список разрешенных URL во вкладке 'Советники'", "Ошибка", MB_ICONINFORMATION);
      return;
   }
   else
      Print("res: "+(string)res);
   
   Print(CharArrayToString(result));
}
//+------------------------------------------------------------------+
 
Can't log in to my account via android - says I need to allow cookies, but they are allowed by default

... Logged in via ucbrowser, but won't log in via chrome for some reason
 

Hello. What's the problem with the validator? I keep getting "no trading operations" error, always on EURUSD, sometimes on other pairs. I started with my EA, which was not validated, keeps giving me this error, so I have to look for the problem and remove different conditions. I have decided to write a simple EA, which opens orders on every tick. The error did not disappear. Here is the code of this simple EA. What to do?

//+------------------------------------------------------------------+
//|                                                        Valid.mq4 |
//+------------------------------------------------------------------+
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{
   return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{

}
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
{
   int result = 0;
   //---
   result = OrderSend(NULL, OP_BUY, 1, Ask, 100, 0, 0, NULL, 5875, 0, clrNONE);
   //---
   result = OrderSend(NULL, OP_BUY, 1, Ask, 100, Ask - 1000 * _Point, Ask + 1000 * _Point, NULL, 5875, 0, clrNONE); 
   //---
   result = OrderSend(NULL, OP_SELL, 1, Bid, 100, 0, 0, NULL, 5875, 0, clrNONE);
   //---
   result = OrderSend(NULL, OP_SELL, 1, Bid, 100, Bid + 1000 * _Point, Bid - 1000 * _Point, NULL, 5875, 0, clrNONE); 
   //---
   return;
}
//+------------------------------------------------------------------+

Error

 
Alexandr Nikolaev:

Hello. What's the problem with the validator? I keep getting "no trading operations" error, always on EURUSD, sometimes on other pairs. I started with my EA, which was not validated, kept giving me this error, so I have to look for the problem and remove different conditions. I have decided to write a simple EA, which opens orders on every tick, and what do you think? The error did not disappear. Here is the code of this simple EA. What to do?


In the real world, the minimum lot is not always 1.0, and there may only be $2.5 on a trading account...
 
Vladimir Karputov:
In the real world, the minimum lot is not always equal to 1.0, and the money in the trading account may be only $2.5 ...

It's not about the lot, I was putting any lot, and doing lot normalisation, and there would be errors, but here it doesn't swear at anything, except there is not a single trade.

 
Alexandr Nikolaev:

Hello. What's the problem with the validator? I keep getting "no trading operations" error, always on EURUSD, sometimes on other pairs. I started with my EA, which was not validated, kept giving me this error, so I have to look for the problem and remove different conditions. I have decided to write a simple EA, which opens orders on every tick, and what do you think? The error did not disappear. Here is the code of this simple EA. What to do?

   int result = 0;
   //---
   result = OrderSend(NULL, OP_BUY, 1, Ask, 100, 0, 0, NULL, 5875, 0, clrNONE); 
   //---
   result = OrderSend(NULL, OP_BUY, 1, Ask, 100, Ask - 1000 * _Point, Ask + 1000 * _Point, NULL, 5875, 0, clrNONE); 
   //---
   result = OrderSend(NULL, OP_SELL, 1, Bid, 100, 0, 0, NULL, 5875, 0, clrNONE);
   //---
   result = OrderSend(NULL, OP_SELL, 1, Bid, 100, Bid + 1000 * _Point, Bid - 1000 * _Point, NULL, 5875, 0, clrNONE); 
   //---
   return;

There is no price normalization, not everywhere you can open an order with a take and a stop loss at once.

 
Alexandr Nikolaev:

Hello. What's the problem with the validator? I keep getting "no trading operations" error, always on EURUSD, sometimes on other pairs. I started with my EA, which was not validated, keeps giving me this error, so I have to look for the problem and remove different conditions. I have decided to write a simple EA, which opens orders on every tick. The error did not disappear. Here is the code of this simple EA. What to do?


It means you're a little early in the market............

 
Vladimir Pastushak:

There is no price normalisation, not everywhere you can open an order with a take and a stop loss at once.

Have you read my post carefully? I didn't intentionally complicate the code with different normalizations and checks. I always do that in Expert Advisors. You see that in the code there are attempts to open an order without SL and TP? I specifically registered such attempts, but they didn't work. The purpose of this EA is not to open orders as it should be but to make attempts to at least make some errors and it seems to be 0 attempts here.

Reason: