paukas: The current bar is in the conditions. The tester sees it as already completed. And the actual cloze high and low is not yet known, only the opener.
Holy shit. All conditions are met. The code can't pass the last condition where the order parameters are. There are no candlestick parameters. And they are not used at all in the whole piece of code. Only Ask and Bid prices.
So you have a buystop order. Then you watch when the price comes close to it and try to remove it. Imho, but it's about the freeze level. Try to rewrite the code like this:
And frankly, it seems strange to me to delete an order only when the price is close to it.
Thank you. I'll give it a try. Why doesn't the log report anything? There is no attempt to delete the order.
Thank you. I will try. And why there is no message in the log? I mean, there are no attempts to delete the order.
It's hard to tell. Only check output will help to figure it out. If there are no errors, it means that the Ask > (OrderOpenPrice() - 4 * Point condition does not work.
I suggest that you print the values for now, so that you have something to deal with if the situation happens again. In the meantime, I can only guess.
And here's something else I noticed yesterday. Yesterday I put two completely identical codes, one running on the server on one account and the other at home on the other account. Both are demo accounts of one brokerage company. The conditions are exactly the same. Except for the hardware.
The order was deleted on the first account and the trade was not opened. On the second one, on the contrary, the order was not deleted and the deal was opened.
Holy shit. All conditions are met. The code cannot pass the last condition where the order parameters are. There are no candlestick parameters. And they are not used at all in the whole piece of code. Only Ask and Bid prices.
That is not the case. They are compared to something, aren't they?
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 spread is always fixed.
The current bar is in the conditions. The tester sees it as already completed. And the actual cloze high and low is not yet known, only the opener.
Holy shit. All conditions are met. The code can't pass the last condition where the order parameters are. There are no candlestick parameters. And they are not used at all in the whole piece of code. Only Ask and Bid prices.
That's what you think.
Well, there are no errors in the logbook.
So you have a buystop order. Then you watch when the price comes close to it and try to remove it. Imho, but it's about the freeze level. Try to rewrite the code like this:
And frankly, it seems strange to me to delete an order only when the price is close to it.
Thank you. I'll give it a try. Why doesn't the log report anything? There is no attempt to delete the order.
Thank you. I will try. And why there is no message in the log? I mean, there are no attempts to delete the order.
It's hard to tell. Only check output will help to figure it out. If there are no errors, it means that the Ask > (OrderOpenPrice() - 4 * Point condition does not work.
I suggest that you print the values for now, so that you have something to deal with if the situation happens again. In the meantime, I can only guess.
And here's something else I noticed yesterday. Yesterday I put two completely identical codes, one running on the server on one account and the other at home on the other account. Both are demo accounts of one brokerage company. The conditions are exactly the same. Except for the hardware.
The order was deleted on the first account and the trade was not opened. On the second one, on the contrary, the order was not deleted and the deal was opened.
Holy shit. All conditions are met. The code cannot pass the last condition where the order parameters are. There are no candlestick parameters. And they are not used at all in the whole piece of code. Only Ask and Bid prices.