This is the part that is causing it
// Function to perform HTTP requestintWebRequest(
conststring method,
conststring url,
conststring headers,
int timeout,
constchar data[],
string &result
)
{
int startTime = GetTickCount();
while (timeout > 0)
{
Print("Making request to URL:", url);
int request = WebRequest(method, url, headers, 0, data, result); // Set timeout to 0 for one-time callif (request != -1)
{
// Print the response data for debuggingPrint("Response data:", result);
return request;
}
Print("Error in MyWebRequest. Error code =", GetLastError());
int elapsed = GetTickCount() - startTime;
if (elapsed < 1000)
{
Sleep(1000 - elapsed);
}
timeout--;
startTime = GetTickCount();
}
Print("WebRequest timeout reached. Aborting request for URL:", url);
return -1; // or handle the timeout error accordingly
}
// Internal function for HTTP requestint WebRequestInternal(
conststring method,
conststring url,
conststring headers,
constchar data[],
string &result
)
{
int request = WebRequest(method, url, headers, 0, data, result); // Set timeout to 0 for one-time callreturn request;
}
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.
The function "WebRequest" is an internal function and reserved. Don't try to redefine it, much less create an infinite recursion.
Or an infinite request with an error code = 0
What do you mean "I did that originally"?
Show your proper original code (all relevant parts of it)!
If it throws a "stock overflow error" then you probably have an "infinite recursion". Do you understand what that means?
It means that the function is calling itself over and over.
"infinite recursion
Yes just don't know how to stop it
What do you mean "I did that originally"?
Show your proper original code (all relevant parts of it)!
If it throws a "stock overflow error" then you probably have an "infinite recursion". Do you understand what that means?
It means that the function is calling itself over and over.
Infinite loop, only happen when I changed the request function. But not changing it, keeping with the example, it did nothing
You still have not show your proper code, so there is not much more that can be said.
You still have not show your proper code, so there is not much more that can be said.
I did show the code
That was the code that redefines an internal reserved function with infinite recursion. It is "bad" code that needs to be fixed.
So, show the new fixed code that properly addresses the issues pointed out.
You also stated that your original code did not do that, so why have you not shown that original code instead?
If you want help with the code, then you need to be more forthcoming. We cannot read your mind nor see your computer.
I did show the code
That was the code that redefines an internal reserved function with infinite recursion. It is "bad" code that needs to be fixed.
So, show the new fixed code that properly addresses the issues pointed out.
You also stated that your original code did not do that, so why have you not shown that original code instead?
If you want help with the code, then you need to be more forthcoming. We cannot read your mind nor see your computer.
You mean the entire code? it is the Web Request function that is the issue and I have no idea which is why I am here
That was the code that redefines an internal reserved function with infinite recursion. It is "bad" code that needs to be fixed.
So, show the new fixed code that properly addresses the issues pointed out.
You also stated that your original code did not do that, so why have you not shown that original code instead?
If you want help with the code, then you need to be more forthcoming. We cannot read your mind nor see your computer.
No, the original function here for wen request that you said use. That was the original and it did not do anything, did not serve any purpose