Discussion of article "Step-by-Step Guide to Writing an Expert Advisor in MQL5 for Beginners" - page 15

 

This error message appears in the compiler

and in the strategy tester this error message appears


All in all in the EURUSD and on the H1 chart.


Can you please help me?


LG

 

I am trying to compile the code provided in this tutorial but getting the error

iADX: wrong parameter count

at the following line

adxHandle=iADX(NULL,0,ADX_Period);

The code seems fine to me. How do I fix the error?

Could anyone help?

 
Carl Schreiber:
Which warning - which error messages in the Journal tab?

Unfortunately I get the same error message!


The advisor does not work with an ECN broker.


This is extremely frustrating that nothing works very well with the new MT5 and I want to switch to the newer version!


Thank you very much!

 
I don't have any experience with mt5 (yet), but mt5 recognises two account types hedging and netting - it's possible that these don't go together for you!
 

First opens 1 sell, then 1 buy and then a bunch of positions to buy, in the end all quickly drains. The code of checking for open positions is incorrect. I have not changed anything in the code

 

I tried to change the condition for opening a position at SAR crossing in the source code - it worked. Then I added the code of trailing (change of position by SAR) from the MQL5 reference book on the MqlTradeRequest structure. But it keeps generating the error [Invalid stops]. Apparently, something is wrong with the query. By the way, I am trying to study it (request to open a position) in different variants. And I got stuck on position modification. I don't understand at all, what am I doing wrong???? I have attached the Expert Advisor to this message.

Files:
SAR_SAR.mq5  27 kb
 

Please tell me how to fix the code so that after take profit, the EA would not open a deal immediately, and waited for the next signal, for example, if the buy signal worked, closed at take profit, then wait for the sell signal.

After that only a new buy signal is triggered

Общие принципы - Торговые операции - Справка по MetaTrader 5
Общие принципы - Торговые операции - Справка по MetaTrader 5
  • www.metatrader5.com
Перед тем как приступить к изучению торговых функций платформы, необходимо создать четкое представление об основных терминах: ордер, сделка и позиция. — это распоряжение брокерской компании купить или продать финансовый инструмент. Различают два основных типа ордеров: рыночный и отложенный. Помимо них существуют специальные ордера Тейк Профит...
 

Hello! very good tutorial, it's well explained, thank you!

But I have a problem, I got this error:

failed market buy 0.10 EURUSD sl: 1.04917 tp: 1.06217[Invalid request].

Alert: failed to complete purchase order request-error: 4756


 
Dear Samuel
your article was magnificent.
i'm not sure if anyone could have wrote a better beginner guideline.
looking forward to your new articles.

Best Regards

 

Hi,


I have a custom indicator, how to I create an EA, like in your example?