Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 498

 
Aleksey Vyazmikin:

Set file (Expert Advisor settings file) and currency pair, so that you can reproduce the situation.

AUDUSD D1, what is the set file and where is it located?
 

Forum on trading, automated trading systems & strategy testing

Any questions for beginners on MQL4, help and discussion on algorithms and codes

Aleksey Vyazmikin, 2018.03.22 19:20


I should add that judging by the code there should be a separate log file where all information about the EA's work is written, including errors if the file fails to open.

Look for this file in the folder through the terminal's menu "File" - "Open Data Folder" and there will be the path MQL4\Files - somewhere in there should be the file that writes this EA.


The set file is a file with EA settings, when you call the EA there are buttons meaning "save" and "load" - the settings must be saved in a file and posted here.

 
Aleksey Vyazmikin:

The set file is the file with the settings of the EA, when you call the EA there are buttons meaning "save" and "load" - the settings should be saved in the file and posted here.

I hope this is the file
Files:
AUDUSD_D1.txt  2 kb
 
ivanskyy:

I'll try to open it by hand at 00:00. Thank you.

If anyone can tell me the code, I'd appreciate it.

I have a rough idea what it's about. It is, of course, at the level of guessing by coffee grounds. But the order should be checked if it is opened and if the result is positive, then it should be changed.
And of course nobody has cancelled the check of possibility to trade.

 
Konstantin Nikitin:

I have a rough idea of what's going on. Of course, this is at the level of guessing by coffee grounds. But we should check if the order has been opened and only if the result is positive, we should change the conditions.
And of course nobody has cancelled the check of possibility to trade.

What is a check for the possibility of trade? I have a good feeling about it. Thanks.
 
When testing an EA in mt4 and changing a spread in the tester, the test results in the report do not change, although in the report tab the spread value is the one I changed, what could be the problem?
 
ivanskyy:
I hope it is the same file

This is just you giving me the log file...

I ran it in the tester with default settings, only selected the "write log" function, and this is what you see in the log file

2016.01.22 00:00:00,SendOrder: AUDCAD, Type=Buy, Lots=20.00, Price=0.9989, StopLoss=0.9935, TakeProfit=0.0000, Magic=21081219, Response=1,

2016.01.22 00:00:00,OpenNewPosition: SendOrder Response = Ok

2016.01.22 00:00:00,Position: Time=00:00:00, Type=Long, Lots=20.00, Price=0.9989, StopLoss=0.9935, TakeProfit=0.0000, Commission=0.00, Profit=1238.00, "Magic=21081219"

If there was a signal to open, you should have the first line, but if there was an error, the LastError=0 will not be equal to zero, and subsequent lines will not confirm the opening.

Therefore, set "Write_Log_File==true" in settings and compare two log files (one in MQL4\Files folder and one in tester\files folder).

 
Aleksey Vyazmikin:

This is just you giving me the log file...

I ran it in the tester with default settings, only selected the "write log" function, and this is what you see in the log file

2016.01.22 00:00:00,SendOrder: AUDCAD, Type=Buy, Lots=20.00, Price=0.9989, StopLoss=0.9935, TakeProfit=0.0000, Magic=21081219, Response=1,

2016.01.22 00:00:00,OpenNewPosition: SendOrder Response = Ok

2016.01.22 00:00:00,Position: Time=00:00:00, Type=Long, Lots=20.00, Price=0.9989, StopLoss=0.9935, TakeProfit=0.0000, Commission=0.00, Profit=1238.00, "Magic=21081219"

If there was a signal to open, you should have the first line, but if there was an error, the LastError=0 will not be equal to zero, and subsequent lines will not confirm the opening.

Therefore, set "Write_Log_File==true" in settings and compare two log files (one in MQL4\Files folder and one in tester\files folder).

If you look in the tester, it is trading but there are no trades on the demo and it seems it does not even try to open orders.

I managed to open it manually at 00:00 yesterday, so the problem is rather in the code somewhere.

Does Magic Number affect anything?
 
ivanskyy:

If you look in the tester it trades but there are no trades on the demo and it seems it does not even try to open orders.

I have been able to open it manually at 00:00 yesterday, so the problem is more likely in the code somewhere.

Does Magic Number affect anything?

Magic does not affect the opening. What about the EA's log? Has it made an attempt to open a position?

Can it always work on the demo, or did it not open at the beginning of the day on the demo as well?
Совершение сделок - Торговые операции - MetaTrader 5
Совершение сделок - Торговые операции - MetaTrader 5
  • www.metatrader5.com
Торговая деятельность в платформе связана с формированием и отсылкой рыночных и отложенных ордеров для исполнения брокером, а также с управлением текущими позициями путем их модификации или закрытия. Платформа позволяет удобно просматривать торговую историю на счете, настраивать оповещения о событиях на рынке и многое другое. Открытие позиций...
 
Aleksey Vyazmikin:

Magic has no effect on the opening. What about in your EA's log? Did it make an attempt to open a position?

On the demo it can always work, or on the demo it did not open at the beginning of the day either?

It didn't open it on the demo.

Reason: