Errors, bugs, questions - page 120

 

What do I have to do to find out if a position is open or not?

This is how the "position not found" error is displayed

if(PositionSelect(СИМВОЛ)==true)
It's true that there is no position, but why does it give out an error? I need it to be without error...
 
sandex:

It would be a funny thing if it was the other way round on the championship server.



Thanks for the comment. There will be no surprises on the Championship. It was not fully checked in the tester. We will fix it in the next build.

 
Dmitriy2:

I need it to be without error...

What's wrong with it?

You get both a clear result of false and a clear description of why false is false.

 

the January 2010 ticks are not being generated. what is the problem?


FD 0 Tester 15:25:15 MetaTester 5 build 319 (02 Sep 2010)
GS 0 Server 15:25:15 MetaTester 5 started on 127.0.0.1:3000
JE 0 Startup 15:25:15 initialization finished
HQ 0 127.0.0.1 15:25:16 login (build 319)
PQ 0 Network 15:25:16 3124 bytes of account info loaded
NI 0 Network 15:25:16 3768 bytes of group info loaded
OL 0 Network 15:25:16 7170 bytes of tester parameters loaded
IH 0 Network 15:25:16,275 bytes of selected symbols loaded
JM 0 Tester 15:25:16 expert file added: Experts\martin1.ex5. 3887 bytes loaded
GI 0 Tester 15:25:16 initial deposit 100000.00 USD, leverage 1:100
JP 0 Tester 15:25:16 successfully initialized
DE 0 Network 15:25:16 21 Kb of total initialization data received
ES 0 15:25:16 performance: 87
PJ 0 Symbols 15:25:17 EURUSD: symbol synchronized, 2904 bytes of symbol info received
NL 0 History 15:1525:18 EURUSD: load 27 bytes of history data to synchronize
QD 0 History 15:25:18 EURUSD: history synchronized from 2006.01.02 to 2010.09.01
RM 0 History 15:25:20 EURUSD: contains 364428 M1 records of beginning data from 2009.01.02 06:01 to 2009.12.31 18:59
LN 0 History 15:25:20 EURUSD,M15: history cache reserved for estimated 27154 bars
RN 0 History 15:25:20 EURUSD,M15: history begins since 2009.01.02 06:00
GF 0 Tester 15:25:20 EURUSD,M15: 1 minutes OHLC ticks generating
EL 0 Tester 15:25:20 EURUSD,M15: testing of experts\martin1.ex5 from 2010.01.01 00:00 to 2010.02.01 00:00:00 started with inputs:
MQ 0 Tester 15:25:20 SL=300
GL 0 Tester 15:25:20 TP=400
QH 0 Tester 15:25:20 OnTester result 0
PJ 0 Tester 15:25:20 EURUSD,M15: 0 ticks (0 bars) generated within 0 ms (total bars in history 24565)
EG 0 Tester 15:25:20 log file "D:\Program Files\MetaTrader 5\Tester\Agent-127.0.0.1-3000\logs\20100906.log" written
QG 0 Tester 15:25:21 tester agent shutdown

 
snowman647:

the January 2010 ticks are not being generated. what is the problem?




Please describe it in more detail.

What server, what terminal, what OS, what Expert Advisor.

I just tried it on mine


2010.09.06 16:49:57     Core 1  EURUSD,M15: 1 minutes OHLC ticks generating
2010.09.06 16:49:57     Core 1  EURUSD,M15: history begins from 2009.01.02 06:00
2010.09.06 16:49:57     Core 1  EURUSD,M15: history cache reserved for estimated 27154 bars
2010.09.06 16:49:57     Core 1  EURUSD: contains 364428 M1 records of beginning data from 2009.01.02 06:01 to 2009.12.31 18:59
2010.09.06 16:49:56     Core 1  EURUSD: history synchronized from 1993.05.13 to 2010.09.01
2010.09.06 16:49:54     Core 1  EURUSD: load 27 bytes of history data to synchronize
2010.09.06 16:49:53     Core 1  EURUSD: symbol synchronized, 2904 bytes of symbol info received
...
2010.09.06 16:49:57     Core 1  EURUSD,M15: 111382 ticks (1884 bars) generated within 265 ms (total bars in history 26449)
 
I jumped to conclusions. Deleting the history folder and uploading a new one fixed everything.
Документация по MQL5: Файловые операции / FolderDelete
Документация по MQL5: Файловые операции / FolderDelete
  • www.mql5.com
Файловые операции / FolderDelete - Документация по MQL5
 
alexvd:

What's wrong with it?

You clearly get both the result - false and a clear description of why it is false.

It's like if condition, for example, some expression is checked falsa or true and if falsa I will always get an error...:)

These codes are called"Runtime Errors" what's the error here, that I'm checking if there's a pose or not? Everything was logical in MT4... but it's obviously not done correctly... Do I have to add one more error handler that will process errors that aren't really errors... This is nonsense

Документация по MQL5: Стандартные константы, перечисления и структуры / Коды ошибок и предупреждений / Ошибки времени выполнения
Документация по MQL5: Стандартные константы, перечисления и структуры / Коды ошибок и предупреждений / Ошибки времени выполнения
  • www.mql5.com
Стандартные константы, перечисления и структуры / Коды ошибок и предупреждений / Ошибки времени выполнения - Документация по MQL5
 
stringo:

We'll look into it.

Any news? What could be causing it to write this way. The indicator is standard, nothing is connected to the Expert Advisor, it should work autonomously.
 
_Dude_:
Any news? What can cause this writing. The indicator is standard, nothing is connected to the Expert Advisor, it should work independently.

Try to specify the required indicator explicitly in the Expert properties for nowhttps://www.mql5.com/ru/docs/basis/preprosessor/compilation:

tester_indicator

string

Name of the custom indicator in the format "indicator_name.ex5" .Indicators necessary for testing are determined automatically from iCustom() function calls, if the corresponding parameter is specified as a constant string. For other cases (use of the IndicatorCreate() function or use of a non-constant string in the parameter specifying the indicator name) this property should be

Документация по MQL5: Основы языка / Препроцессор / Свойства программ (#property)
Документация по MQL5: Основы языка / Препроцессор / Свойства программ (#property)
  • www.mql5.com
Основы языка / Препроцессор / Свойства программ (#property) - Документация по MQL5
 

Shouldn't all events be displayed in the logbook?

Here, in the text of the Expert Advisor, there is

Print("BALANCE : ",AccountInfoDouble(ACCOUNT_BALANCE));

there is a fragment after the check where we don't see the order closed on the 5th of January

FO 0 Core 1 12:01:13 2010.01.04 12:00:00 instant buy 2.50 EURUSD at 1.43751 sl: 1.43461 tp: 1.44691 (1.43750 / 1.43751 / 1.43750)
MS 0 Core 1 12:01:13 2010.01.04 12:00:00 deal #4 buy 2.50 EURUSD at 1.43751 done (based on order #4)
GQ 0 Core 1 12:01:13 2010.01.04 12:00:00 deal performed [#4 buy 2.50 EURUSD at 1.43751]
HF 0 Core 1 12:01:13 2010.01.04 12:00:00 order performed buy 2.50 EURUSD at 1.43751 [#4 buy 2.50 EURUSD at 1.43751]
KI 0 Core 1 12:01:13 2010.01.04 12:30:00 BALANCE : 9217
GQ 0 Core 1 12:01:13 2010.01.04 13:00:00 BALANCE : 9217
PF 0 Core 1 12:01:13 2010.01.04 13:30:00 BALANCE : 9217
RO 0 Core 1 12:01:13 2010.01.04 14:00:00 BALANCE : 9217
IG 0 Core 1 12:01:13 2010 01.04 14:30:00 BALANCE : 9217
ML 0 Core 1 12:01:13 2010 01.04 15:00:00 BALANCE : 9217
JE 0 Core 1 12:01:14 2010 01.13 14:30:00 BALANCE : 11394.81

here is the same place when Print is removed

LE 0 Core 1 12:11:25 2010.01.04 12:00:00 instant buy 2.50 EURUSD at 1.43751 sl: 1.43461 tp: 1.44691 (1.43750 / 1.43751 / 1.43750)
GJ 0 Core 1 12:11:25 2010.01.04 12:00:00 deal #4 buy 2.50 EURUSD at 1.43751 done (based on order #4)
MF 0 Core 1 12:11:25 2010.01.04 12:00:00 deal performed [#4 buy 2.50 EURUSD at 1.43751]
OH 0 Core 1 12:11:26 2010.01.04 12:00:00 order performed buy 2.50 EURUSD at 1.43751 [#4 buy 2.50 EURUSD at 1.43751]
GM 0 Core 1 12:11:26 2010.01.05 06:55:54 take profit triggered buy 2.50 EURUSD 1.43751 sl: 1.43461 tp: 1.44691 [#5 sell 2.50 EURUSD at 1.44691]
GJ 0 Core 1 12:11:26 2010.01.05 06:55:54 deal #5 sell 2.50 EURUSD at 1.44691 done (based on order #5)
LP 0 Core 1 12:11:26 2010.01.05 06:55:54 deal performed [#5 sell 2.50 EURUSD at 1.44691]
KQ 0 Core 1 12:11:26 2010.01.05 06:55:54 order performed sell 2.50 EURUSD at 1.44691

Because Print inside void OnTick()?

Reason: