Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1178
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
are we talking about the tester or online?
If online - look at the code, the move event is not routed properly. Panels by the way on the site only five different libraries, what do you mean?
And in the tester - it seems there is no way, and why.
are we talking about the tester or online?
If online - look at the code, somewhere the move event is not routed normally. Panels by the way on the site only five different libraries, what do you mean?
And in the tester - it seems there is no way, and why.
We are talking about online. I really don't need it in the tester. I'm not sure about the libraries - I'm not an expert in programming. I just took a ready code of button from MQL5 Reference.
I've done it already but I have not got any errors, I cannot fix it yet. Apparently this is why button position is updated on the next tick. I don't understand how to make buttons move together with background.
After sending move commands to ALL panel objects do ChartRedraw()
Just inserted it after each if condition.
As a result, I found out that function:
Successfully selects the order to proceed, but ifPrint("Order Selected!"); isinserted after this code:
then an error occurs:
2020.06.17 01:38:24.136 2020.01.02 07:40:00 failed modify order #2 buy stop 0.1 EURUSD_i at 1.12086 sl: 1.12023 tp: 1.12275 -> 1.00000, sl: 1.00000 tp: 1.00000 [Invalid price]
2020.06.17 01:38:24.136 2020.01.02 07:40:00 CTrade::OrderSend: modify #2 at 1.00000 (sl: 1.00000 tp: 1.00000) [invalid price]
I use the same code in another EA for autotrading (the only difference is the absence of such a code):
) and I have no problems. The orders are opened and modified without any problems.
Here is the code itself:
Please tell me what is my mistake?
It's about online. I really don't need it in the tester. I can't answer the question about the libraries, I'm a total dummy in programming. I just took a ready code of button from MQL5 Reference.
I've done it already but I have not got any errors, I cannot fix it yet. Apparently this is why button position is updated on the next tick. I do not understand how to make buttons move along with background.
And how did you determine that it is on the next tick and not on that one?)
Please help to understand. Have code for trading panel to open pending Buy Stop order with subsequent trailing if order fails. The order is opened but there is no modification of the order. No errors are shown in the journal and we don't have any attempts to modify the order either. I tried to trace through the log at what stage an error occurs using the function:
Just inserted it after each if condition.
As a result, I found out that the function:
Successfully selects the order to proceed, but ifPrint("Order Selected!"); isinserted after this code:
then an error occurs:
2020.06.17 01:38:24.136 2020.01.02 07:40:00 failed modify order #2 buy stop 0.1 EURUSD_i at 1.12086 sl: 1.12023 tp: 1.12275 -> 1.00000, sl: 1.00000 tp: 1.00000 [Invalid price]
2020.06.17 01:38:24.136 2020.01.02 07:40:00 CTrade::OrderSend: modify #2 at 1.00000 (sl: 1.00000 tp: 1.00000) [invalid price]
I use the same code in another EA for autotrading (the only difference is the absence of such a code):
) and I have no problems. The orders are opened and modified without any problems.
Here is the code itself:
Can you please tell me what is my mistake?
Obviously, Normalize does not work properly. Unprint asymbol.Digits() asymbol.TickSize(),. Point() check .
Good day to all. Faced this problem when accessing EA to DLL:
Cannot load 'C:\....\shablon.dll' [487]
The error 487 seems to meanERROR_INVALID_ADDRESS but the path to the library is correct. Actually, I already put this dll in all folders, does not help.
What can it be? I will be grateful to you for help.
P.S. At first this dll was for 32 bit and worked in mt4*86. I recompiled it for 64 bit, now i put it on mt5*64 and have such problems.
How do you know what's on the next tick and not on that one?)
Until the new tick arrives, there is no movement of the buttons. That's what I can see with my eyes. As soon as the price changes, the buttons move.
Today, though, even on the new tick, the buttons have stopped redrawing, although I haven't changed anything. Only the background is moving.Apparently Normalize doesn't work properly. rounds up to one. Unprint asymbol.Digits() asymbol.TickSize(),. Point() check .
When I make a query like this:
I get this result:
2020.06.17 13:49:53.270 2020.01.02 06:50:00 Symbol EURUSD_i Digits 5 Point 1e-05
When I make a request like this:
I get this result:
2020.06.17 13:51:58.787 2020.01.02 06:45:00 Symbol EURUSD_i Digits 0 Point 0.0
At the same time I want to note that if I don't insert Print function, I don't get any error at all, the order doesn't even try to modify itself. It is as if CTrade does not see my order.
Checking for symbol and magic number doesn't work:
Result:
2020.06.17 14:37:38.147 2020.01.02 06:50:00 Symbol Magic 0 Ticket 2
Magic number should be 12345, the symbol is euro dollar.
Why can't I get symbol and medgic?
If you change the string:
aorder.Symbol()==asymbol.Name()
is changed to
and remove validation by magic number, then we have problems with prices
2020.06.17 01:38:24.136 2020.01.02 07:40:00 failed modify order #2 buy stop 0.1 EURUSD_i at 1.12086 sl: 1.12023 tp: 1.12275 -> 1.00000, sl: 1.00000 tp: 1.00000 [Invalid price]
2020.06.17 01:38:24.136 2020.01.02 07:40:00 CTrade::OrderSend: modify #2 at 1.00000 (sl: 1.00000 tp: 1.00000) [invalid price]
2020.06.17 01:38:24.136 2020.01.02 07:40:00 BUY STOP modification failed! Result Retcode: 10015, description of Retcode: invalid price
I've already racked my brains, while this same code works fine in another Expert Advisor.
What am I doing wrong?
Good day to all. Faced this problem when accessing EA to DLL:
Cannot load 'C:\....\shablon.dll' [487]
The error 487 seems to meanERROR_INVALID_ADDRESS but the path to the library is correct. Actually, I already put this dll in all folders, does not help.
What can it be? I will be grateful to you for help.
P.S. At first this dll was for 32 bit and worked in mt4*86. I recompiled it for 64 bit and now I put it on mt5*64 and have such problems.
ERROR_INVALID_ADDRESS is not about path. You are passing the wrong arguments.