SQ strategy errors (OnTick critical error) In MT5 but compiles fine

Hi



This is my try for London open strategy. Built from custom template. The strategy compiles in MT5 fine, but when attached to the chart it crashes and when run the MT5 back test, I get the error in the end of the post


SQX build 112 and 113
MetaTrader 5 build 2085


regards


Timo


HR 0 22:43:42.574 Tester GBPUSD#,M30 (Trading.com-MT5): testing of Experts\SQ_GBPUSD\GBPUSDM30H4GBUSD_M30H4Strategy 0.93216LondonOpenALondonOpenA.ex5 from 2019.01.01 00:00 to 2019.08.31 00:00
HH 0 22:43:42.670 Core 1 common synchronization completed
IP 0 22:43:42.822 Tester quality of analyzed history is 99%
OG 0 22:43:45.523 Core 1 test Experts\SQ_GBPUSD\GBPUSDM30H4GBUSD_M30H4Strategy 0.93216LondonOpenALondonOpenA.ex5 on GBPUSD#,M30 thread finished
DI 0 22:43:45.523 Core 1 prepare for shutdown
QS 0 22:43:45.523 Core 1 login (build 2085)
HS 0 22:43:45.523 Core 1 account info found with currency USD
QF 0 22:43:45.523 Core 1 expert file added: Experts\SQ_GBPUSD\GBPUSDM30H4GBUSD_M30H4Strategy 0.93216LondonOpenALondonOpenA.ex5. 356476 bytes loaded
PL 0 22:43:45.523 Core 1 initial deposit 10000.00 USD, leverage 1:100
CE 0 22:43:45.523 Core 1 successfully initialized
PM 0 22:43:45.523 Core 1 348 Kb of total initialization data received
EJ 0 22:43:45.523 Core 1 Intel Core Processor (Haswell, no TSX), 5999 MB
JM 0 22:43:45.523 Core 1 GBPUSD#: load 29 bytes of history data to synchronize in 0:00:00.003
LJ 0 22:43:45.523 Core 1 GBPUSD#: history synchronized from 2018.01.02 to 2019.08.30
NI 0 22:43:45.523 Core 1 GBPUSD#,M30: history cache allocated for 14375 bars and contains 6070 bars from 2018.01.02 00:00 to 2018.12.31 18:30
NI 0 22:43:45.523 Core 1 GBPUSD#,M30: history begins from 2018.01.02 00:00
NN 0 22:43:45.523 Core 1 GBPUSD#,M30 (Trading.com-MT5): every tick generating
FJ 0 22:43:45.523 Core 1 GBPUSD#,M30: testing of Experts\SQ_GBPUSD\GBPUSDM30H4GBUSD_M30H4Strategy 0.93216LondonOpenALondonOpenA.ex5 from 2019.01.01 00:00 to 2019.08.31 00:00 started with inputs:
PP 0 22:43:45.523 Core 1   MaximumRisk=0.02
OF 0 22:43:45.523 Core 1   DecreaseFactor=3
OS 0 22:43:45.523 Core 1   MovingPeriod=12
GD 0 22:43:45.523 Core 1   MovingShift=6
JJ 0 22:43:45.523 Core 1 2019.01.01 00:00:00   ---VERBOSE--- 2019.01.01 00:00 --------------------------------------------------------
MD 0 22:43:45.523 Core 1 2019.01.01 00:00:00   ---VERBOSE--- 2019.01.01 00:00 Starting the EA
FJ 0 22:43:45.523 Core 1 GBPUSD#,H4: history cache allocated for 2224 bars and contains 1186 bars from 2018.01.02 00:00 to 2018.12.31 16:00
FE 0 22:43:45.523 Core 1 GBPUSD#,H4: history begins from 2018.01.02 00:00
OR 0 22:43:45.523 Core 1 program file added: Indicators\SqATR.ex5. 16896 bytes loaded
KR 0 22:43:45.523 Core 1 program file added: Indicators\SqHeikenAshi.ex5. 14443 bytes loaded
RK 0 22:43:45.523 Core 1 2019.01.01 00:00:00   ---VERBOSE--- 2019.01.01 00:00 --------------------------------------------------------
NG 0 22:43:45.523 Core 1 GBPUSD#,Daily: history cache allocated for 435 bars and contains 262 bars from 2018.01.02 00:00 to 2018.12.31 00:00
PJ 0 22:43:45.523 Core 1 GBPUSD#,Daily: 1 bar from 2019.01.02 00:00 added
GK 0 22:43:45.523 Core 1 GBPUSD#,Daily: history begins from 2018.01.02 00:00
NM 2 22:43:45.523 Core 1 2019.01.07 10:30:00   array out of range in 'GBPUSDM30H4GBUSD_M30H4Strategy 0.93216LondonOpenALondonOpenA.mq5' (2278,22)
QQ 2 22:43:45.523 Core 1 OnTick critical error
QD 0 22:43:45.523 Core 1 GBPUSD#,M30: 390847 ticks, 148 bars generated. Environment synchronized in 0:00:00.103. Test passed in 0:00:02.838 (including ticks preprocessing 0:00:01.953).
FS 0 22:43:45.523 Core 1 GBPUSD#,M30: total time from login to stop testing 0:00:02.941 (including 0:00:00.103 for history data synchronization)
CQ 0 22:43:45.523 Core 1 457 Mb memory used including 1.88 Mb of history data, 256 Mb of tick data
RS 0 22:43:45.523 Core 1 log file "C:\Users\Administrator\AppData\Roaming\MetaQuotes\Tester\EE4D2702E4BC9E9EB3DA9D602EE858B7\Agent-127.0.0.1-3000\logs\20190901.log" written
MO 0 22:43:45.555 Core 1 connection closed

Attachments
GBPUSDM30H4GBUSD_M30H4Strategy 093216LondonOpenALondonOpenA.sqx
(219.71 KiB)
GBPUSDM30H4GBUSD_M30H4Strategy 093216LondonOpenALondonOpenA.mq5
(195.70 KiB)
  • Votes 0
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

TN
#1

Timo

01.09.2019 23:58

Task created

h
#2

hankeys

02.09.2019 07:46
build 112? those times i dont remember :)


now, its build 123

TB
#3

Tomas Brynda

02.09.2019 09:23

Status changed from New to Fixed

The sqIndicatorLowest/Highest functions were designed to look back max 200 values.

In your strategy you use period 255 and 244, so that's the problem.


I modified the MQL code and changed the range to 1000 values. It should be enough.

TN
#4

Timo

02.09.2019 22:09
Hi. Thank you all very much! Is this the new range in upcoming release, or is it something that I should change only for this strategy?

btw, is there somekind of verbose/debug node that would allow me to find similar errors in future?

regards


Timo

TB
#5

Tomas Brynda

03.09.2019 08:34
Hi Timo,

we will be releasing new build today and the fix will be there, so you can just update SQ, regenerate MQL code and it will be working fine.


I added alerts when using periods in these functions that are too high. Many kinds of errors are already logged, so you should see potential problems in terminal's journal.


Best regards,

Tomas


Votes: 0

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please