Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 45
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
What's the big deal? It's always been like that.
trader781:
Ну не знаю, я раньше ими не занимался. Если брать случайного бота из кодебазы и прогнать по тем же отрезкам, то он что - то будет делать, этот же просто дохнет при запуске, хотя смотришь - вроде код рабочий и прошлую ошибку я поправил, придраться особо не к чему и компилятор не ругается. Но убивать терминал через диспетчер задач надоедает, да и смысла нет. Проще найти косяк и исправить.
What do Expert Advisors tab logs say? Or the tester's log?
nothing suspicious there either (except for the above)
ran it on a demo, let it work, if I can't fix it I'll let you know the reason
The take parameter is still completely ignored
If it is not equal to zero, it should either show an error or be setnothing suspicious there either (except for the above)
ran it on a demo, let it work, if I can't fix it I'll let you know the reason
so far the take parameter is completely ignored
If it is not equal to zero, it should either fail or be set.Does it open orders in the tester? Does it open even one? Is the log without errors? You should print the error code and calculation parameters passed to trading functions, it makes logical errors much easier to catch.
In the tester, opens one then the second and hangs, in the demo as well, after opening the second CPU load 29% and growing until it hangs
Where is the log? There is no miracle.
2016.12.22 22 22:16:32.249 '14041396': order #161405291 sell 0.01 AUDUSD at 0.72067 sl: 0.00000 tp: 0.00000 closed at price 0.72116
2016.12.22 22 22:16:32.162 '14041396': close order #161405291 sell 0.01 AUDUSD at 0.72067 sl: 0.00000 tp: 0.00000 at price 0.72116
2016.12.22 22 22:16:31.507 '14041396': order #161415692 sell 0.02 AUDUSD at 0.72086 sl: 0.00000 tp: 0.00000 closed at price 0.72115
2016.12.22 22 22:16:31.278 '14041396': close order #161415692 sell 0.02 AUDUSD at 0.72086 sl: 0.00000 tp: 0.00000 at price 0.72115
2016.12.22 22:16:17.002 Expert count AUDUSD,M5: removed
(deleted via terminal stop, existing orders wiped by hand, one log second expert tab)
Need indicator values, on the first closed bar H1.
(deleted via terminal shutdown, the existing orders were covered manually, one log second expert tab)
I have taken the last variant known to me and fixed the most glaring bugs, but the order opens only one and that's it. In general, I do not understand the logic of this EA, it is all written in a weird way.
In general, I hope the next step is clear. I have to fill the code with prints for everything that can and cannot be found and catch logic errors, and there may be more than one. A lot more.
Thank you, it's pretty clear what to do
And the point is simple.
- open an order
- set take profit
- If the price goes down, open a second one after the step with a refill at the average price
- set take out
- If a single take has triggered, close all of them.
I just ran that you threw away so it's true) almost all the code is ignored