Discussing the article: "Developing a multi-currency Expert Advisor (Part 13): Automating the second stage — selection into groups" - page 2

 

Yuri, good afternoon! I managed to run the optimisation of the second stage and it passed. But during the optimisation such errors are constantly in the log:

2024.08.23 01:15:04.636 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,114,1.90,1.90,0,4200.00,100.00,36000,22)
2024.08.23 01:15:04.636 SimpleVolumesStage2 (GBPUSD,M15)               ],20.815987),class CVirtualStrategyGroup([
2024.08.23 01:15:04.636 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,108,0.10,0.20,150,5600.00,1400.00,38000,3)
2024.08.23 01:15:04.636 SimpleVolumesStage2 (GBPUSD,M15)               ],5.784025),class CVirtualStrategyGroup([
2024.08.23 01:15:04.636 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,12,0.10,1.70,50,2800.00,1300.00,14000,4)
2024.08.23 01:15:04.636 SimpleVolumesStage2 (GBPUSD,M15)               ],7.390437),
2024.08.23 01:15:04.636 SimpleVolumesStage2 (GBPUSD,M15)               ],3.791325)',
2024.08.23 01:15:04.636 SimpleVolumesStage2 (GBPUSD,M15)        'i1_=0,i2_=0,i3_=0,i4_=0,i5_=0,i6_=0,i7_=0,i8_=0,i9_=0,i10_=0,i12_=0,i11_=0,i13_=0,i14_=0,i15_=0,i16_=0,idTask_=126,idParentJob_=9,count_=16',
2024.08.23 01:15:04.636 SimpleVolumesStage2 (GBPUSD,M15)        '2024.08.23 01:15:04');
2024.08.23 01:15:04.636 SimpleVolumesStage2 (GBPUSD,M15)        CDatabase::ExecuteTransaction | ERROR: Transaction failed, error code=5601
2024.08.23 01:15:04.693 SimpleVolumesStage2 (GBPUSD,M15)        database error, table passes has 2 columns but 48 values were supplied
2024.08.23 01:15:04.693 SimpleVolumesStage2 (GBPUSD,M15)        CDatabase::Execute | ERROR: 5601 in query
2024.08.23 01:15:04.693 SimpleVolumesStage2 (GBPUSD,M15)        INSERT INTO passes VALUES (NULL, 126, 504, 10000.00,0.00,6639.64,9498.28,-2858.64,99.33,-32.07,530.81,43.00,530.81,43.00,-170.53,13.00,-147.20,16.00,9957.48,192.99,1.54,1.72,191.61,9895.68,495.00,4.38,4.38,495.00,4.43,3.32,13.41,3.49,6109.55,2681.00,1500.00,1065.00,435.00,676.00,824.00,506.00,559.00,7.00,3.00,99.86,6717.06,'class CVirtualStrategyGroup([
2024.08.23 01:15:04.693 SimpleVolumesStage2 (GBPUSD,M15)                class CVirtualStrategyGroup([
2024.08.23 01:15:04.693 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,12,0.10,0.10,0,5400.00,1900.00,7000,7)
2024.08.23 01:15:04.693 SimpleVolumesStage2 (GBPUSD,M15)               ],4.758732),class CVirtualStrategyGroup([
2024.08.23 01:15:04.693 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,18,0.50,1.50,50,5800.00,1600.00,3000,27)
2024.08.23 01:15:04.693 SimpleVolumesStage2 (GBPUSD,M15)               ],10.092854),class CVirtualStrategyGroup([

And in the end, as I realised, nothing was added to the database.... The only thing in the tasks database changed the status of the tasks of the second stage and the time of their execution.

What does this error mean and where to dig? Where should the information about the passes be recorded and should it be recorded at all? If it should be written as passes or at the end of the whole stage in one transaction all in the database?

 

Hello Victor.

I have not observed this, so it is indeed an error. Judging by this line of the log:

2024.08.23 01:15:04.693 SimpleVolumesStage2 (GBPUSD,M15)        database error, table passes has 2 columns but 48 values were supplied

I can assume that in your main database the passes table has been replaced by the one that should have been created only in the second database. That is, this table now has 2 columns instead of 48.

 
Information about passes of the second stage is written to the main base as each pass is completed. That is the same place where information about passes of the first stage is written to
 

I dealt with this issue and ran the second stage. Passages in the main base were added. But a new problem appeared... Now with the third Expert Advisor. For some reason, it does not take the passes that you specify in the list, but takes the first ones from the beginning from the passes table. And now there is an assumption that the EA of the second stage worked the same way and the whole optimisation is wrong. I don't understand how to solve it yet.

According to your idea, where should the task database be created, in the Common\Files folder or in the MQL5\Files folder of the terminal?

 

The third Expert Advisor is also sorted out, it seems to work as it should. Thank you for the Expert Advisor and this series of articles.

PS: I noticed such a moment, it is certainly not a problem, but still, - when testing in visual mode in the tester, the Expert Advisor opens a lot of separate orders, often by 0.01 lot. As I understand it, each virtual strategy opens its own positions. But if you look at the scheme from the 3rd article, then according to the last scheme it should open one position on each trading instrument and just adjust the volume depending on the total lot and direction of all open virtual positions. It is like working on a netting account. Maybe it's just a glitch in the tester or it's just the way positions are displayed there.... Yuri, is it possible to enable the EA to work on the hage account as if on a netting account and have only one position in the market for each trading instrument?

 
If I understand correctly, this is not possible in MT5. If we want netting execution, we need to open a netting account. If we stay on a hedge account, we can only realise the work through one position by closing the existing position completely and opening a new one with a different volume at each correction. And this gives nothing but additional losses on commissions and environment.
For better visualisation, it may be more convenient to use one position per symbol. But it is easier to open another demo account (or not demo) with netting for testing.
 

Yuri hello. I am now optimising the second stage, and in the log I occasionally get a database occupancy error:

2024.09.02 10:38:33.294 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 288
2024.09.02 10:38:38.294 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 288
2024.09.02 10:38:43.293 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 288
2024.09.02 10:38:48.293 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 288
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)        database error, database is locked
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)        CDatabase::Execute | ERROR: 5605 in query
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)        INSERT INTO passes VALUES (NULL, 288, 360, 10000.00,0.00,7003.37,9407.08,-2403.71,46.87,-28.78,941.40,59.00,941.40,59.00,-146.47,7.00,-87.89,13.00,9984.47,146.78,0.94,0.94,146.78,9933.81,217.95,1.92,1.92,217.95,5.57,3.91,32.13,4.09,7507.03,2340.00,1258.00,889.00,369.00,595.00,663.00,430.00,459.00,9.00,4.00,99.96,16091.26,'class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,24,0.10,0.10,150,5800.00,1800.00,31000,5)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],6.543218),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,16,0.10,0.10,0,2400.00,1200.00,27000,5)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],4.995504),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,120,0.50,1.90,50,2800.00,1200.00,60000,19)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],13.285506),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,38,1.30,1.30,50,3800.00,1100.00,13000,25)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],10.046213),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,32,0.50,0.90,100,2800.00,1100.00,2000,3)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],10.450413),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,32,0.50,0.90,150,2800.00,1100.00,2000,3)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],10.254307),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,12,0.10,0.10,150,2800.00,1500.00,21000,16)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],2.232143),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,120,0.50,1.90,0,2800.00,1200.00,16000,11)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],9.453583),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,120,0.50,1.90,0,2800.00,1200.00,27000,23)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],9.453583),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,120,0.50,1.90,0,2800.00,1200.00,39000,19)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],9.453583),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,28,0.60,0.30,0,2800.00,1300.00,52000,5)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],4.348582),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,42,0.50,0.60,150,2400.00,1600.00,2000,3)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],6.733553),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,12,0.10,0.30,150,5800.00,1900.00,51000,4)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],7.383343),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,32,0.50,0.90,150,2600.00,1100.00,1000,3)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],8.483203),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,12,0.10,0.10,150,5800.00,1900.00,38000,7)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],2.723237),class CVirtualStrategyGroup([
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)                class CSimpleVolumesStrategy("GBPUSD",15,34,0.60,0.40,0,2200.00,1300.00,51000,5)
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],4.561836),
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)               ],4.588208)',
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)        'i1_=0,i2_=0,i3_=0,i4_=0,i5_=0,i6_=0,i7_=0,i8_=0,i9_=0,i10_=0,i12_=0,i11_=0,i13_=0,i14_=0,i15_=0,i16_=0,idTask_=288,idParentJob_=18,count_=16',
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)        '2024.09.02 10:38:50');
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)        CDatabase::ExecuteTransaction | ERROR: Transaction failed, error code=5605
2024.09.02 10:38:53.293 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 288
2024.09.02 10:38:58.293 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 288
2024.09.02 10:39:03.323 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 288
2024.09.02 10:39:08.292 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 288
2024.09.02 10:39:13.305 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 288

The Expert Advisor is original, from the article. I am optimising on local agents of a PC and on the local network on agents of another PC. In general, the process is going on and passes to the database are filled, but I would like to understand what causes this error, and how to fix it?

It also happens that some tasks of the second stage finish very quickly. For example:

2024.09.02 10:45:08.288 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 288
2024.09.02 10:45:13.302 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 288
2024.09.02 10:45:18.288 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 288
2024.09.02 10:45:18.397 Optimization (EURUSD,M5)        FinishTask | Task ID = 288
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        StartTask | Task ID = 289
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        [Tester]
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        Expert=SimpleVolumesStage2.mq5
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        Symbol=NZDCAD
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        Period=H1
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        Optimization=2
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        Model=1
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        FromDate=2021.01.01
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        ToDate=2023.01.01
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        ForwardMode=0
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        Deposit=10000
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        Currency=USD
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        ProfitInPips=0
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        Leverage=200
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        ExecutionMode=0
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        OptimizationCriterion=6
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        [TesterInputs]
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        idTask_=289||0||0||0||N
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        idParentJob_=19||0||1||10||N
2024.09.02 10:45:18.406 Optimization (EURUSD,M5)        
2024.09.02 10:45:24.340 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 289
2024.09.02 10:45:24.444 Optimization (EURUSD,M5)        FinishTask | Task ID = 289
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        StartTask | Task ID = 290
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        [Tester]
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        Expert=SimpleVolumesStage2.mq5
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        Symbol=NZDCAD
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        Period=M30
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        Optimization=2
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        Model=1
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        FromDate=2021.01.01
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        ToDate=2023.01.01
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        ForwardMode=0
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        Deposit=10000
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        Currency=USD
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        ProfitInPips=0
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        Leverage=200
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        ExecutionMode=0
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        OptimizationCriterion=6
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        [TesterInputs]
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        idTask_=290||0||0||0||N
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        idParentJob_=20||0||1||10||N
2024.09.02 10:45:24.452 Optimization (EURUSD,M5)        
2024.09.02 10:45:29.219 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 290
2024.09.02 10:45:33.301 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 290
2024.09.02 10:45:38.301 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 290
2024.09.02 10:45:38.397 Optimization (EURUSD,M5)        FinishTask | Task ID = 290
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        StartTask | Task ID = 291
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        [Tester]
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        Expert=SimpleVolumesStage2.mq5
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        Symbol=NZDCAD
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        Period=M15
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        Optimization=2
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        Model=1
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        FromDate=2021.01.01
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        ToDate=2023.01.01
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        ForwardMode=0
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        Deposit=10000
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        Currency=USD
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        ProfitInPips=0
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        Leverage=200
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        ExecutionMode=0
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        OptimizationCriterion=6
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        [TesterInputs]
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        idTask_=291||0||0||0||N
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        idParentJob_=21||0||1||10||N
2024.09.02 10:45:38.408 Optimization (EURUSD,M5)        
2024.09.02 10:45:41.008 SimpleVolumesStage2 (NZDCAD,M15)        OnTesterInit | ERROR: Can't load data from file database892.sqlite.
2024.09.02 10:45:41.008 SimpleVolumesStage2 (NZDCAD,M15)        Check that it exists in data folder or in common data folder.
2024.09.02 10:45:44.259 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 291
2024.09.02 10:45:44.366 Optimization (EURUSD,M5)        FinishTask | Task ID = 291
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        StartTask | Task ID = 292
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        [Tester]
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        Expert=SimpleVolumesStage2.mq5
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        Symbol=NZDCHF
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        Period=H1
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        Optimization=2
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        Model=1
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        FromDate=2021.01.01
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        ToDate=2023.01.01
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        ForwardMode=0
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        Deposit=10000
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        Currency=USD
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        ProfitInPips=0
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        Leverage=200
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        ExecutionMode=0
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        OptimizationCriterion=6
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        [TesterInputs]
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        idTask_=292||0||0||0||N
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        idParentJob_=22||0||1||10||N
2024.09.02 10:45:44.376 Optimization (EURUSD,M5)        
2024.09.02 10:45:49.277 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 292
2024.09.02 10:45:49.381 Optimization (EURUSD,M5)        FinishTask | Task ID = 292
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        StartTask | Task ID = 293
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        [Tester]
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        Expert=SimpleVolumesStage2.mq5
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        Symbol=NZDCHF
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        Period=M30
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        Optimization=2
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        Model=1
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        FromDate=2021.01.01
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        ToDate=2023.01.01
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        ForwardMode=0
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        Deposit=10000
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        Currency=USD
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        ProfitInPips=0
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        Leverage=200
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        ExecutionMode=0
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        OptimizationCriterion=6
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        [TesterInputs]
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        idTask_=293||0||0||0||N
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        idParentJob_=23||0||1||10||N
2024.09.02 10:45:49.391 Optimization (EURUSD,M5)        
2024.09.02 10:45:54.334 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 293
2024.09.02 10:45:58.330 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 293
2024.09.02 10:46:03.316 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 293
2024.09.02 10:46:08.322 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 293
2024.09.02 10:46:13.304 Optimization (EURUSD,M5)        OnTimer | Current Task ID = 293

Here for example NZDCAD H1 M30 and NZDCHF H1 ended literally in one pass of the optimiser as I understand. Although there are many passes of the first stage for them in the database. Why does this happen and what can be done about it?

And NZDCAD M15 gave an error at all. As I understand it does not find data in the database, but how is this possible? After all, at the first stage of optimisation of these pairs was and passes should be in the database....

Yuri, is it possible to do this for example: I have conducted the first and the second stage and saved everything in one database. And it is possible then (after the second stage) to change, in the database, the status of tasks of the first stage for those pairs and tf on which the second stage gave bad results, so that for these pairs and tf as if on top of the second stage to add passes of the first stage, and then for them to carry out again the second stage? Simply at such action id of new passes of the first stage will be higher than id of passes of the second stage for all other pairs in this base. I mean the table passes. Is it possible to do so, and will the optimiser find passes of the first stage for these pairs and tf?

 
Hello Victor.
First of all, check that you do not have two instances of the Optimisation Expert Advisor running in different terminal charts. I will answer about the rest later.
 
No, two copies excluded.
 
2024.09.02 10:38:50.882 SimpleVolumesStage2 (GBPUSD,M15)        database error, database is locked

A database is open and locked somewhere. It can also be an external application in relation to the tester, for example, MetaEditor. I don't remember encountering anything like this.

2024.09.02 10:45:41.008 SimpleVolumesStage2 (NZDCAD,M15)        OnTesterInit | ERROR: Can't load data from file database892.sqlite.
2024.09.02 10:45:41.008 SimpleVolumesStage2 (NZDCAD,M15)        Check that it exists in data folder or in common data folder.

It does indicate that the first stage passes for NZDCAD M15 have not been found for some reason.

  А можно потом (после второго этапа) поменять, в базе данных, статус задач первого этапа для тех пар и тф на которых второй этап дал плохие результаты, чтобы для этих пар и тф как бы поверх второго этапа добавить проходов первого этапа ещё, а потом для них провести повторно второй этап? Просто при таком действии id новых проходов первого этапа будет выше чем id  проходов второго этапа для всех остальных пар в этой базе. Я имею веду таблицу passes. Можно так сделать, и найдёт ли оптимизатор проходы превого этапа для этих пар и тф?

Yes, you can do this as many times as you want. If you want the old passes from the previous first stages not to remain, you can delete them from the passes table by the required id_task.