Brand new to MQL5 (and FOREX for that matter) but, long time programmer. I opened the My_First_EA.mq5 file and compiled but, I'm not getting the Debug functions. If I open any of the example script files I do get the Debug option. Also received a warning return value of 'OrderSend' should be checked. What do I have to do to get Debug functionality?
Brand new to MQL5 (and FOREX for that matter) but, long time programmer. I opened the My_First_EA.mq5 file and compiled but, I'm not getting the Debug functions. If I open any of the example script files I do get the Debug option. Also received a warning return value of 'OrderSend' should be checked. What do I have to do to get Debug functionality?
Louis
Hi All,
Figured out my own issue. I created a new Project with the Expert Advisor Wizard and then just copied in the My_First_EA.mq5 file and I get debug functionality.
Figured out my own issue. I created a new Project with the Expert Advisor Wizard and then just copied in the My_First_EA.mq5 file and I get debug functionality.
Louis
But have you fixed the 'OrderSend should be checked' warning?
I'v got 4756 error, I saw the solution in page 2, and I checked orginal code, there was ZeroMemory(mrequest); in line 218 itself. but I have still the error 4756.
I also still have this error having made both suggested corrections:
ZeroMemory(mrequest);
and also
if(Buy_opened || Sell_opened)
Please can someone help with the error 4756? It just seems unable to place a Buy Order.
I have changed several things in the code but it doesn't work, I add the code I have:
Original: mrequest.type_filling = "I have put it in the 3 ways that are in the documentation".
mrequest.action = TRADE_ACTION_DEAL; // immediate order execution
mrequest.price = NormalizeDouble(latest_price.ask,_Digits); // latest ask price
mrequest.sl = NormalizeDouble(latest_price.ask - STP*_Point,_Digits); // Stop Loss
mrequest.tp = NormalizeDouble(latest_price.ask + TKP*_Point,_Digits); // Take Profit
mrequest.symbol = _Symbol; // currency pair
mrequest.volume = Lot; // number of lots to trade
mrequest.magic = EA_Magic; // Order Magic Number
mrequest.type = ORDER_TYPE_BUY; // Buy Order
mrequest.type_filling = ORDER_FILLING_RETURN; // Order execution type
mrequest.deviation=100;
Tambien he probado este codigo:
//--- declaration and initialisation of the request and resultMqlTradeRequest request={0};
MqlTradeResult result={0};
//--- application parameters
request.action =TRADE_ACTION_DEAL; // type of business operation
request.symbol =Symbol(); // symbol
request.volume =0.1; // volume of 0.1 lot
request.type =ORDER_TYPE_BUY; // order type
request.price =SymbolInfoDouble(Symbol(),SYMBOL_ASK); // opening price
request.deviation=5; // permissible price deviation
request.magic =EA_Magic; // Magical number of the order//--- sending the applicationif(!OrderSend(request,result))
PrintFormat("OrderSend error %d",GetLastError()); // if the request could not be sent, enter the error code//--- information on the operationPrintFormat("retcode=%u deal=%I64u order=%I64u",result.retcode,result.deal,result.order);
Hello, Thank you for the tutorial, it was very helpful. But i have a misunderstanding, the New_Time variables declared and initialized with the CopyTimes function but Old_Time was declared but not initialized at first and then it was compared to the New_Time variable to verify is there a new bar. Old_Time is supposed to be empty. I don't know i described it well but thanks for reading.
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 All,
Brand new to MQL5 (and FOREX for that matter) but, long time programmer. I opened the My_First_EA.mq5 file and compiled but, I'm not getting the Debug functions. If I open any of the example script files I do get the Debug option. Also received a warning return value of 'OrderSend' should be checked. What do I have to do to get Debug functionality?
Louis
Hi All,
Brand new to MQL5 (and FOREX for that matter) but, long time programmer. I opened the My_First_EA.mq5 file and compiled but, I'm not getting the Debug functions. If I open any of the example script files I do get the Debug option. Also received a warning return value of 'OrderSend' should be checked. What do I have to do to get Debug functionality?
Louis
Hi All,
Figured out my own issue. I created a new Project with the Expert Advisor Wizard and then just copied in the My_First_EA.mq5 file and I get debug functionality.
Louis
Hi All,
Figured out my own issue. I created a new Project with the Expert Advisor Wizard and then just copied in the My_First_EA.mq5 file and I get debug functionality.
Louis
I'v got 4756 error, I saw the solution in page 2, and I checked orginal code, there was ZeroMemory(mrequest); in line 218 itself. but I have still the error 4756.
I also still have this error having made both suggested corrections:
ZeroMemory(mrequest);
and also
if(Buy_opened || Sell_opened)
Please can someone help with the error 4756? It just seems unable to place a Buy Order.
Hi, I'm getting an error:
return value of 'OrderSend'should be checked lines 213 and 259.
have you solved it?
Good morning Tchuso,
The same thing happened to me. I fixed it by replacing those lines in both operations with this.
Tell me if you need help, I'm new too.
Best regards!
I like the example code quite a lot, I'm new to this too, I fixed the code as it appears in the comments and it doesn't give errors anymore.
The problem is that the robot does not open trades, it does not even open a trade.
Has anyone been able to solve this problem?
I'm using the "Unico" option of the strategy tester: is it my mistake?
Thanks for your time and supportI noticed that the Robot tries to open the orders but always gives an error:
Exit:
2020.05.06 20:35:16.141 Core 1 2020.04.20 20:25:00 failed market sell 0.10 EURUSD sl: 1.08965 tp: 1.07665 [Invalid request].
I have changed several things in the code but it doesn't work, I add the code I have:
Original: mrequest.type_filling = "I have put it in the 3 ways that are in the documentation".
I noticed that the Robot tries to open the orders but always gives an error:
Exit:
2020.05.06 20:35:16.141 Core 1 2020.04.20 20:25:00 failed market sell 0.10 EURUSD sl: 1.08965 tp: 1.07665 [Invalid request].
I have changed several things in the code but it doesn't work, I add the code I have:
Original: mrequest.type_filling = "I have put it in the 3 ways that are in the documentation".
Add this at the top of the code:
#include <Trade\Trade.mqh>And then to open an operation just type this:
Hi,
Similarly, I have the error code 4756 when running testing and said " Sell order request could not be completed ".
Please inform how to solve this.
Thank