Can you add MACD indicator to this Expert Advisor?
***
You can. Perhaps someone will do it, if there will be a desire.
***
And in line 239 I get an error after compilation:'iTime' - function not defined Lego EA.mq5 239 20.
There is no error. It is 1940 build, and you are probably using a very, very old build. I strongly recommend you to update.
Good afternoon!
The Expert Advisor opens a position by the signal of the selected indicator, and closes it by the set Take Profit or Stop Loss.
What do I need to set to close the position according to the signal of the selected indicator?
Regards,
Pavel Buglak
I set the following parameters:
Take Profit: 200
Stop Loss: 200
Use STO to open = true,
Use STO to close = true
As a result, it opens by the indicator signal, but closes by TAke Profit or Stop Loss.
I understand this EA should close the position also on the signal of the selected indicator (crossing of lines).
I set Take Profit = 1, Stop Loss = 1 - does not work at all.
I set Take Profit = 0, Stop Loss = 0 - opens one position and does not close in any way until the end of the testing period.
Good afternoon!
The Expert Advisor opens a position by the signal of the selected indicator, and closes it by the set Take Profit or Stop Loss.
What do I need to set in order to close the position according to the signal of the selected indicator?
Regards,
Pavel Buglak
First of all, allow to work only on one indicator. Allow to open and close positions using this indicator. Set Stop Loss and Take Profit to "0.0".
I have done so.
I set 0.0 for Take profit and Stop Loss in the code
Still does not want to work only on Stochastic.
It opens one position and holds it until the end of the testing period.
Closing does not happen.
Thank you for creating EAs and promptly responding to testing.
I can't find the updated EA in CodeBase.
Could you please send me the link?
I want to test this EA for a 30-year period.
Thank you for creating advisors and responding promptly to testing.
I cannot find the updated Expert Advisor in CodeBase.
Could you please send me the link?
I want to test this EA for a 30 year period.
https://www.mql5.com/en/code/22900
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use


Lego EA:
The Expert Advisor combines signals from several indicators. It can also follow a certain indicator.
Author: Vladimir Karputov