Is the price which you are sending with the order correct?
Not sure, how do you tell. Sometimes there is a few trades in like 30 or so and
eventually it gets an error. I am assuming that means that price has changed however,
with the error 135 refresh rates it should clear it.
Also, the script works no matter what. It just doesn't work in the EA. Can We just
call the script?
result = OrderClose(OrderTicket(),OrderLots(),price,3,CLR_NONE);
Print("Current Chart Price = "+Close[0]+" Order Closing Price = "+price);
if(result != TRUE){Print("GOT AN ERROR ON THAT ONE");
result = OrderClose(OrderTicket(),OrderLots(),price,3,CLR_NONE);
Print("Current Chart Price = "+Close[0]+" Order Closing Price = "+price);
if(result != TRUE){Print("GOT AN ERROR ON THAT ONE");
I will try it. Looks to me like you are incrementing the close price and
then adjusting the variable as well to match it?
Also, since you are apparently handling many orders, put a refresh in the loop.
while(OrdersTotal() > 0){// Loop through all orders and close themfor(inti = (OrdersTotal() - 1); i >= 0; i--){RefreshRates();
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
Also, since you are apparently handling many orders, put a refresh in the loop.
while(OrdersTotal() > 0){// Loop through all orders and close themfor(inti = (OrdersTotal() - 1); i >= 0; i--){RefreshRates();
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
Ok, thanks I will try it. Takes some time to create the positive effect and
see if it works. I only forward test.
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.
Is the price which you are sending with the order correct?
Not sure, how do you tell. Sometimes there is a few trades in like 30 or so and eventually it gets an error. I am assuming that means that price has changed however, with the error 135 refresh rates it should clear it.
Also, the script works no matter what. It just doesn't work in the EA. Can We just call the script?
I will try it. Looks to me like you are incrementing the close price and then adjusting the variable as well to match it?
Nope.
Just printing out what the chart says is the current bid and what you are sending to close the order.
This is an alternate way of builing a string to print:
string xxx = "there";
Print("Hello ", xxx);
Print("Hello "+xxx)
Should get the same printout.
Also, since you are apparently handling many orders, put a refresh in the loop.
Also, since you are apparently handling many orders, put a refresh in the loop.
Ok, thanks I will try it. Takes some time to create the positive effect and see if it works. I only forward test.