Don't do such things in the OnInit() event handler. You are blocking the thread and preventing a proper initialisation process. Do it in one of the other event handlers, or use a Script instead of an EA.
Don't do such things in the OnInit() event handler. You are blocking the thread and preventing a proper initialisation process. Do it in one of the other event handlers, or use a Script instead of an EA.
I tried in a script -as you said- and got the same error: "Error when trying to call API: 5203".
Put the code OnStart() function of the script.
Before trying to do what you want to do, first do some testing with very simple web access with a "GET", without headers and such, to make sure you are doing things correctly. Then slowly work your way up while debugging it.
Also, make sure that the URL has been granted permission in the MetaTrader settings.
Before trying to do what you want to do, first do some testing with very simple web access with a "GET", without headers and such, to make sure you are doing things correctly. Then slowly work your way up while debugging it.
Also, make sure that the URL has been granted permission in the MetaTrader settings.
int OnInit() { char d[]; char d2[]; string hRes; int r = WebRequest("GET", "https://google.com", "", 5000, d, d2, hRes); if ( r != 200 ) { Print("No" + (string)GetLastError()); } else { Print("Yes"); string res = hRes; Print(res); } return(INIT_SUCCEEDED); }Guess now, I can do some testing with the Notion API GET functions and see what it's happening.
If you are referring to your question ... MT4 Script File path issues, then this thread is unrelated. You have been given an answer on your thread, however.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
So, I want to create a EA to communicate with my Notion DB each time I close a trade. My main problem is that I cannot connect to my Notion DB; server throws me a 5203 error. Don't know if I am doing the headers wrong or what else I am doing wrong.
Here is my code: