Why "undeclared identifier" even though I've done everything correctly?
-

I can't fix this kind of problem. I don't know what to do.
Here is the code inside the custom MQL code.int ErrorCode; string RequestMethod = "POST"; string Google_Sheets_API_URL = "xxxxxx"; string headers, messagestring; char msgData[], result[]; string result_headers; int timeout = 10000; //----- Create Header ----- headers = "Content-Type: application/json\r\n"; // ----- Create Message Char Array ----- messagestring = "{" "\"order_type\": \"" + position_type + "\"," "\"currency\": \"" + Currency + "\"," "\"timeframe\": \"" + timeframe + "\"," "\"open_price\": \"" + DoubleToString(pending_open_price, 5) + "\"," "\"tp\": \"" + DoubleToString(tp_price, 5) + "\"," "\"sl\": \"" + DoubleToString(sl_price, 5) + "\"," "\"trading_score\": \"" + IntegerToString(trading_score) + "\"," "\"trading_analyst\": \"" + trading_analyst + "\"," "\"ticket_number\": \"" + IntegerToString(ticket_number) + "\"," "\"time_stamp\": \"" + time_stamp + "\"" "}"; StringToCharArray(messagestring, msgData, 0, WHOLE_ARRAY, CP_UTF8); ArrayResize(msgData, ArraySize(msgData) - 1); //----- Send HTTP Request ----- int res = WebRequest(RequestMethod, Google_Sheets_API_URL, headers, timeout, msgData, result, result_headers); if (res == 1) { ErrorCode = GetLastError(); Print("WebRequest Error:", ErrorCode); if (ErrorCode == 4060) { Alert("Add the address '" + Google_Sheets_API_URL + "' in the list of allowed URLs on tab 'Expert Advisrs' "); } } else { Print("Server response: ", CharArrayToString(result)); } -
Are you suer all those variables you are showing were correctly created on fxDreema? I mean those exact names.
-
@l-andorrà Yes, Im sure. this picture and code show this.
-
Then I'm afraid I don't know the reason, sorry. Probably the reason is within that custom code. We need a programmer here, and I'm not I'm afraid.
-
Try OP_BUYLIMIT
-
Everything you have there does work on FX I've done it many times, occasionally fx goes wrong and the way to fix is start from scratch. I would create a small test project just doing 1 variable, then move on until they all work