Experts: Lego EA

 

Lego EA:

The Expert Advisor combines signals from several indicators. It can also follow a certain indicator.

Author: Vladimir Karputov

 

Can you add MACD indicator to this EA?

And in line 239 an error pops up after compilation:'iTime' - function not defined Lego EA.mq5 239 20

 
romaks888:

Can you add MACD indicator to this Expert Advisor?

***

You can. Perhaps someone will do it, if there will be a desire.


romaks888:

***

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.

 
Pavlo Buglak:

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.

 

Here are all the settings:


 

Thank you very much for noticing the flaw!

I was overthinking the position control a lot.

Version"1.001" has been published. Please try it.

 

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.

 
Pavlo Buglak:

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

Lego EA
Lego EA
  • www.mql5.com
или же включить только один из индикаторов. Можно комбинировать условия: на открытие брать сигналы с одного индикатора, а условия на закрытия брать с другого индикатора. Например CCI: use CCI to open отвечает за использование сигналов CCI на открытие, а CCI: use CCI to close отвечает за использование индикатора...