-
Notifications
You must be signed in to change notification settings - Fork 28
/
executioncontext.cpp
1889 lines (1651 loc) · 223 KB
/
executioncontext.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "expander.h"
#include "lib/conversion.h"
#include "lib/executioncontext.h"
#include "lib/format.h"
#include "lib/helper.h"
#include "lib/math.h"
#include "lib/string.h"
#include "lib/terminal.h"
#include "lib/tester.h"
#include "lib/timeseries.h"
#include "struct/rsf/ExecutionContext.h"
#include "struct/rsf/Order.h"
#include "struct/rsf/Test.h"
#include <math.h>
#include <time.h>
#include <vector>
MqlProgramList g_mqlPrograms(1); // all MQL programs: index 0 is not a valid pid and is always empty
std::vector<DWORD> g_threads; // all known threads executing MQL programs
std::vector<uint> g_threadsPrograms; // pid of the last MQL program executed by a thread
uint g_lastUIThreadProgram; // pid of the last MQL program executed by the UI thread
CRITICAL_SECTION g_terminalMutex; // mutex for application-wide locking
extern uint g_terminalBuild; // terminal build number
struct RECOMPILED_MODULE { // A struct holding the last MQL module with UninitReason UR_RECOMPILE.
uint pid; // Only one module is tracked (the last one) and the variable is accessed
ModuleType type; // from the UI thread only.
char name[_MAX_FNAME];
} g_recompiledModule;
/**
* Core function call order of multiple tests with VisualMode=on
* =============================================================
*
* Indicators loaded by iCustom() are reloaded into the existing tester chart with IR_PROGRAM_AFTERTEST and unloaded when the tester chart closes.
*
* --- start of test (chart window opens) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 21:07:44.038 SyncMainContext_init(152) 084F44E0 TestExpert UR_UNDEFINED ec={} (0x084F44E0)
* 21:07:44.053 SyncMainContext_init(298) 084F44E0 TestExpert UR_UNDEFINED ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_INIT, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=NULL, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=0x099583C0, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x084F44E0)
* 21:07:44.116 SyncLibContext_init(534) 084F48C8 rsfLib1 UR_UNDEFINED ec={} (0x084F48C8)
* 21:07:44.116 SyncLibContext_init(764) 084F48C8 rsfLib1 UR_UNDEFINED ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_INIT, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=NULL, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=0x099583C0, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x084F48C8)
* 21:07:44.131 SyncMainContext_start(368) 084F44E0 TestExpert ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_START, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=25766, changedBars=-1, unchangedBars=-1, ticks=1, cycleTicks=1, lastTickTime="2018.01.02 00:00:00", prevTickTime=0, bid=1.35066, ask=1.35067, superContext=NULL, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=0x099583C0, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F44E0)
* --- expert loaded ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 21:07:44.194 SyncMainContext_init(152) 084F4CB0 Trix UR_UNDEFINED ec={} (0x084F4CB0)
* 21:07:44.194 SyncMainContext_init(298) 084F4CB0 Trix UR_UNDEFINED ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_INIT, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=0x084F44E0, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F4CB0)
* 21:07:44.241 SyncLibContext_init(534) 084F5098 rsfLib1 UR_UNDEFINED ec={} (0x084F5098)
* 21:07:44.241 SyncLibContext_init(764) 084F5098 rsfLib1 UR_UNDEFINED ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_INIT, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=0x084F44E0, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5098)
* 21:07:44.241 SyncMainContext_start(368) 084F4CB0 Trix ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_START, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=25766, changedBars=25766, unchangedBars=0, ticks=1, cycleTicks=1, lastTickTime="2018.01.02 00:00:00", prevTickTime=0, bid=1.35066, ask=1.35067, superContext=0x084F44E0, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F4CB0)
* --- indicator loaded ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* --- test finished --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 21:07:46.893 SyncMainContext_deinit(389) 084F4CB0 Trix UR_CHARTCLOSE ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_START, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=0x084F44E0, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F4CB0)
* 21:07:46.893 SyncMainContext_deinit(410) 084F4CB0 Trix UR_CHARTCLOSE ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_DEINIT, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=0x084F44E0, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F4CB0)
* 21:07:46.893 LeaveContext(836) 084F4CB0 Trix ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_DEINIT, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=0x084F44E0, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F4CB0)
* 21:07:46.893 SyncLibContext_deinit(785) 084F5098 rsfLib1 UR_UNDEFINED ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=0x084F44E0, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5098)
* 21:07:46.893 SyncLibContext_deinit(806) 084F5098 rsfLib1 UR_CHARTCLOSE ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=0x084F44E0, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5098)
* 21:07:46.893 LeaveContext(836) 084F5098 rsfLib1 ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=0x084F44E0, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5098)
* --- indicator unloaded -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 21:07:46.893 SyncMainContext_deinit(389) 084F44E0 TestExpert UR_UNDEFINED ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_START, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=0x099583C0, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F44E0)
* 21:07:46.893 SyncMainContext_deinit(410) 084F44E0 TestExpert UR_UNDEFINED ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_DEINIT, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=0x099583C0, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F44E0)
* 21:07:46.893 LeaveContext(836) 084F44E0 TestExpert ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_DEINIT, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=0x099583C0, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F44E0)
* 21:07:46.893 SyncLibContext_deinit(785) 084F48C8 rsfLib1 UR_UNDEFINED ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=0x099583C0, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F48C8)
* 21:07:46.893 SyncLibContext_deinit(806) 084F48C8 rsfLib1 UR_UNDEFINED ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=0x099583C0, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F48C8)
* 21:07:46.893 LeaveContext(836) 084F48C8 rsfLib1 ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=0x099583C0, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F48C8)
* --- end of test: expert unloaded -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*
* --- chart window becomes visible (if it was minimized) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* --- indicator reloads with stateful libraries in UI thread ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 21:07:57.189 SyncLibContext_init(534) 084F5098 rsfLib1 UR_UNDEFINED ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=NULL, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=0x084F44E0, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5098)
* 21:07:57.189 SyncLibContext_init(764) 084F5098 rsfLib1 UR_CHARTCLOSE ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3492 (UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5098)
* 21:07:57.189 SyncMainContext_init(152) 084F44E0 Trix UR_CHARTCLOSE ec={} (0x084F44E0)
* 21:07:57.189 SyncMainContext_init(298) 084F44E0 Trix UR_CHARTCLOSE ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_INIT, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3492 (UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x084F44E0)
*
*
* --- start of next test (new chart window opens) ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* --- expert reloads with stateful libraries ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 21:08:05.347 SyncLibContext_init(534) 084F48C8 rsfLib1 UR_UNDEFINED ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=NULL, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x08F10020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3880 (non-UI), hChart=0x00090DC2, hChartWindow=0x000B0DDE, test=0x099583C0, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F48C8)
* 21:08:05.347 SyncLibContext_init(764) 084F48C8 rsfLib1 UR_UNDEFINED ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=NULL, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=NULL, threadId=3184 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F48C8)
* 21:08:05.347 SyncMainContext_init(152) 084F4CB0 TestExpert UR_UNDEFINED ec={} (0x084F4CB0)
* 21:08:05.347 SyncMainContext_init(298) 084F4CB0 TestExpert UR_UNDEFINED ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_INIT, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=NULL, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=0x0995F938, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x084F4CB0)
* 21:08:05.347 SyncMainContext_start(368) 084F4CB0 TestExpert ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_START, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=25766, changedBars=-1, unchangedBars=-1, ticks=1, cycleTicks=1, lastTickTime="2018.01.02 00:00:00", prevTickTime=0, bid=1.35066, ask=1.35067, superContext=NULL, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=0x0995F938, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F4CB0)
* --- expert loaded ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 21:08:05.410 SyncMainContext_init(152) 084F5480 Trix UR_UNDEFINED ec={} (0x084F5480)
* 21:08:05.410 SyncMainContext_init(298) 084F5480 Trix UR_UNDEFINED ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_INIT, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=0x084F4CB0, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5480)
* 21:08:05.472 SyncLibContext_init(534) 084F5868 rsfLib1 UR_UNDEFINED ec={} (0x084F5868)
* 21:08:05.472 SyncLibContext_init(764) 084F5868 rsfLib1 UR_UNDEFINED ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_INIT, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=0x084F4CB0, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5868)
* 21:08:05.472 SyncMainContext_start(368) 084F5480 Trix ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_START, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=25766, changedBars=25766, unchangedBars=0, ticks=1, cycleTicks=1, lastTickTime="2018.01.02 00:00:00", prevTickTime=0, bid=1.35066, ask=1.35067, superContext=0x084F4CB0, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5480)
* --- indicator loaded ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* --- test finished --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 21:08:08.545 SyncMainContext_deinit(389) 084F5480 Trix UR_CHARTCLOSE ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_START, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=0x084F4CB0, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5480)
* 21:08:08.545 SyncMainContext_deinit(410) 084F5480 Trix UR_CHARTCLOSE ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_DEINIT, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=0x084F4CB0, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5480)
* 21:08:08.545 LeaveContext(836) 084F5480 Trix ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_DEINIT, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=0x084F4CB0, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5480)
* 21:08:08.545 SyncLibContext_deinit(785) 084F5868 rsfLib1 UR_UNDEFINED ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=0x084F4CB0, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5868)
* 21:08:08.545 SyncLibContext_deinit(806) 084F5868 rsfLib1 UR_CHARTCLOSE ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=0x084F4CB0, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5868)
* 21:08:08.545 LeaveContext(836) 084F5868 rsfLib1 ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=0x084F4CB0, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5868)
* --- indicator unloaded -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 21:08:08.545 SyncMainContext_deinit(389) 084F4CB0 TestExpert UR_UNDEFINED ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_START, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=0x0995F938, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F4CB0)
* 21:08:08.545 SyncMainContext_deinit(410) 084F4CB0 TestExpert UR_UNDEFINED ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_DEINIT, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=0x0995F938, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F4CB0)
* 21:08:08.545 LeaveContext(836) 084F4CB0 TestExpert ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_DEINIT, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=0x0995F938, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F4CB0)
* 21:08:08.545 SyncLibContext_deinit(785) 084F48C8 rsfLib1 UR_UNDEFINED ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=0x0995F938, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F48C8)
* 21:08:08.545 SyncLibContext_deinit(806) 084F48C8 rsfLib1 UR_UNDEFINED ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=0x0995F938, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F48C8)
* 21:08:08.545 LeaveContext(836) 084F48C8 rsfLib1 ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=0x0995F938, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F48C8)
* --- end of test: expert unloaded -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*
* --- chart window becomes visible (if it was minimized) -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* --- indicator reloads with stateful libraries in UI thread ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 21:08:08.561 SyncLibContext_init(534) 084F5868 rsfLib1 UR_UNDEFINED ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=NULL, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x09FE0020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=0x084F4CB0, threadId=3184 (non-UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5868)
* 21:08:08.561 SyncLibContext_init(764) 084F5868 rsfLib1 UR_CHARTCLOSE ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3492 (UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x084F5868)
* 21:08:08.561 SyncMainContext_init(152) 084F4CB0 Trix UR_CHARTCLOSE ec={} (0x084F4CB0)
* 21:08:08.561 SyncMainContext_init(298) 084F4CB0 Trix UR_CHARTCLOSE ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_INIT, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3492 (UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x084F4CB0)
* --- chart window is closed -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 21:08:39.999 SyncMainContext_deinit(389) 084F4CB0 Trix UR_CLOSE ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_INIT, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3492 (UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x084F4CB0)
* 21:08:39.999 SyncMainContext_deinit(410) 084F4CB0 Trix UR_CLOSE ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_DEINIT, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_CLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3492 (UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x084F4CB0)
* 21:08:39.999 LeaveContext(836) 084F4CB0 Trix ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_DEINIT, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_CLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3492 (UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x084F4CB0)
* 21:08:39.999 SyncLibContext_deinit(785) 084F5868 rsfLib1 UR_UNDEFINED ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_CLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3492 (UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x084F5868)
* 21:08:39.999 SyncLibContext_deinit(806) 084F5868 rsfLib1 UR_CLOSE ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_CLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3492 (UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x084F5868)
* 21:08:39.999 LeaveContext(836) 084F5868 rsfLib1 ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_CLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41532, superContext=NULL, threadId=3492 (UI), hChart=0x000D0DE2, hChartWindow=0x00080D8C, test=NULL, testing=TRUE, visualMode=TRUE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x084F5868)
* --- indicator unloaded ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*/
/**
* Core function call order of multiple tests with VisualMode=off
* ==============================================================
*
* Between tests indicators loaded by iCustom() are reloaded with IR_PROGRAM_AFTERTEST and immediately unloaded.
*
* --- start of test -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 07:30:03.888 SyncMainContext_init(67) 0733A448 TestExpert UR_UNDEFINED ec={} (0x0733A448)
* 07:30:03.888 SyncMainContext_init(213) 0733A448 TestExpert UR_UNDEFINED ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_INIT, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=NULL, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08E6E940, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x0733A448)
* 07:30:03.951 SyncLibContext_init(446) 07210248 rsfLib1 UR_UNDEFINED ec={} (0x07210248)
* 07:30:03.951 SyncLibContext_init(673) 07210248 rsfLib1 UR_UNDEFINED ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_INIT, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=NULL, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08E6E940, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x07210248)
* 07:30:03.951 SyncMainContext_start(283) 0733A448 TestExpert ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_START, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=25766, changedBars=-1, unchangedBars=-1, ticks=1, cycleTicks=1, lastTickTime="2018.01.02 00:00:00", prevTickTime=0, bid=1.35066, ask=1.35076, superContext=NULL, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08E6E940, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0733A448)
* --- expert loaded ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 07:30:04.013 SyncMainContext_init(67) 0747D9F0 Trix UR_UNDEFINED ec={} (0x0747D9F0)
* 07:30:04.013 SyncMainContext_init(213) 0747D9F0 Trix UR_UNDEFINED ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_INIT, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=0x0733A448, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0747D9F0)
* 07:30:04.091 SyncLibContext_init(446) 0742F0D8 rsfLib1 UR_UNDEFINED ec={} (0x0742F0D8)
* 07:30:04.091 SyncLibContext_init(673) 0742F0D8 rsfLib1 UR_UNDEFINED ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_INIT, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=0x0733A448, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0742F0D8)
* 07:30:04.091 SyncMainContext_start(283) 0747D9F0 Trix ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_START, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=25766, changedBars=25766, unchangedBars=0, ticks=1, cycleTicks=1, lastTickTime="2018.01.02 00:00:00", prevTickTime=0, bid=1.35066, ask=1.35076, superContext=0x0733A448, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0747D9F0)
* --- indicator loaded ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* --- test finished --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 07:30:04.528 SyncMainContext_deinit(304) 0747D9F0 Trix UR_CHARTCLOSE ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_START, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=0x0733A448, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0747D9F0)
* 07:30:04.528 SyncMainContext_deinit(325) 0747D9F0 Trix UR_CHARTCLOSE ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_DEINIT, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=0x0733A448, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0747D9F0)
* 07:30:04.528 LeaveContext(743) 0747D9F0 Trix ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_DEINIT, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=0x0733A448, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0747D9F0)
* 07:30:04.528 SyncLibContext_deinit(692) 0742F0D8 rsfLib1 UR_UNDEFINED ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=0x0733A448, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0742F0D8)
* 07:30:04.528 SyncLibContext_deinit(713) 0742F0D8 rsfLib1 UR_CHARTCLOSE ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=0x0733A448, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0742F0D8)
* 07:30:04.528 LeaveContext(743) 0742F0D8 rsfLib1 ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=0x0733A448, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0742F0D8)
* --- indicator unloaded -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 07:30:04.528 SyncMainContext_deinit(304) 0733A448 TestExpert UR_UNDEFINED ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_START, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08E6E940, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0733A448)
* 07:30:04.528 SyncMainContext_deinit(325) 0733A448 TestExpert UR_UNDEFINED ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_DEINIT, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08E6E940, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0733A448)
* 07:30:04.528 LeaveContext(743) 0733A448 TestExpert ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_DEINIT, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08E6E940, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0733A448)
* 07:30:04.528 SyncLibContext_deinit(692) 07210248 rsfLib1 UR_UNDEFINED ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08E6E940, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07210248)
* 07:30:04.528 SyncLibContext_deinit(713) 07210248 rsfLib1 UR_UNDEFINED ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08E6E940, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07210248)
* 07:30:04.528 LeaveContext(743) 07210248 rsfLib1 ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08E6E940, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07210248)
* --- end of test: expert unloaded -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*
*
* --- start of next test ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* --- indicator reloads with stateful libraries in UI thread ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 07:30:06.296 SyncLibContext_init(446) 0742F0D8 rsfLib1 UR_UNDEFINED ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=NULL, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=0x0733A448, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0742F0D8)
* 07:30:06.296 SyncLibContext_init(673) 0742F0D8 rsfLib1 UR_CHARTCLOSE ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=2896 (UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0742F0D8)
* 07:30:06.296 SyncMainContext_init(67) 0D02D490 Trix UR_CHARTCLOSE ec={} (0x0D02D490)
* 07:30:06.296 SyncMainContext_init(213) 0D02D490 Trix UR_CHARTCLOSE ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_INIT, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=2896 (UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x0D02D490)
* --- indicator unloads in UI thread ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 07:30:06.296 SyncMainContext_deinit(304) 0D02D490 Trix UR_REMOVE ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_INIT, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=2896 (UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x0D02D490)
* 07:30:06.296 SyncMainContext_deinit(325) 0D02D490 Trix UR_REMOVE ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_DEINIT, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_REMOVE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_REMOVE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=2896 (UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x0D02D490)
* 07:30:06.296 LeaveContext(743) 0D02D490 Trix ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_DEINIT, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_REMOVE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_REMOVE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=2896 (UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x0D02D490)
* 07:30:06.296 SyncLibContext_deinit(692) 0742F0D8 rsfLib1 UR_UNDEFINED ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_REMOVE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=2896 (UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x0742F0D8)
* 07:30:06.296 SyncLibContext_deinit(713) 0742F0D8 rsfLib1 UR_REMOVE ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_REMOVE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_REMOVE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=2896 (UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x0742F0D8)
* 07:30:06.296 LeaveContext(743) 0742F0D8 rsfLib1 ec={pid=2, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM_AFTERTEST, programUninitReason=UR_REMOVE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_REMOVE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=0, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=2896 (UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x0742F0D8)
* --- indicator unloaded ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*
* --- expert reloads with stateful libraries ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 07:30:06.328 SyncLibContext_init(446) 07210248 rsfLib1 UR_UNDEFINED ec={pid=1, previousPid=0, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=NULL, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=1564 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08E6E940, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07210248)
* 07:30:06.328 SyncLibContext_init(673) 07210248 rsfLib1 UR_UNDEFINED ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=NULL, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=NULL, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07210248)
* 07:30:06.328 SyncMainContext_init(67) 07210C88 TestExpert UR_UNDEFINED ec={} (0x07210C88)
* 07:30:06.328 SyncMainContext_init(213) 07210C88 TestExpert UR_UNDEFINED ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_INIT, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=NULL, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08EDD9D8, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=TRUE, customLogFile=""} (0x07210C88)
* 07:30:06.328 SyncMainContext_start(283) 07210C88 TestExpert ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_START, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=25766, changedBars=-1, unchangedBars=-1, ticks=1, cycleTicks=1, lastTickTime="2018.01.02 00:00:00", prevTickTime=0, bid=1.35066, ask=1.35076, superContext=NULL, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08EDD9D8, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07210C88)
* --- expert loaded ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 07:30:06.390 SyncMainContext_init(67) 0747D5C0 Trix UR_UNDEFINED ec={} (0x0747D5C0)
* 07:30:06.390 SyncMainContext_init(213) 0747D5C0 Trix UR_UNDEFINED ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_INIT, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=0x07210C88, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0747D5C0)
* 07:30:06.452 SyncLibContext_init(446) 07330998 rsfLib1 UR_UNDEFINED ec={} (0x07330998)
* 07:30:06.452 SyncLibContext_init(673) 07330998 rsfLib1 UR_UNDEFINED ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_INIT, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=NULL, bars=0, changedBars=-1, unchangedBars=-1, ticks=0, cycleTicks=0, lastTickTime=0, prevTickTime=0, bid=0, ask=0, superContext=0x07210C88, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07330998)
* 07:30:06.452 SyncMainContext_start(283) 0747D5C0 Trix ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_START, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=25766, changedBars=25766, unchangedBars=0, ticks=1, cycleTicks=1, lastTickTime="2018.01.02 00:00:00", prevTickTime=0, bid=1.35066, ask=1.35076, superContext=0x07210C88, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0747D5C0)
* --- indicator loaded ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* --- test finished --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 07:30:06.905 SyncMainContext_deinit(304) 0747D5C0 Trix UR_CHARTCLOSE ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_START, programInitReason=IR_PROGRAM, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=0x07210C88, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0747D5C0)
* 07:30:06.905 SyncMainContext_deinit(325) 0747D5C0 Trix UR_CHARTCLOSE ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_DEINIT, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=0x07210C88, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0747D5C0)
* 07:30:06.905 LeaveContext(743) 0747D5C0 Trix ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=CF_DEINIT, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_INDICATOR, moduleName="Trix", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=0x07210C88, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x0747D5C0)
* 07:30:06.905 SyncLibContext_deinit(692) 07330998 rsfLib1 UR_UNDEFINED ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=0x07210C88, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07330998)
* 07:30:06.905 SyncLibContext_deinit(713) 07330998 rsfLib1 UR_CHARTCLOSE ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=0x07210C88, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07330998)
* 07:30:06.905 LeaveContext(743) 07330998 rsfLib1 ec={pid=4, previousPid=0, programType=PT_INDICATOR, programName="Trix", programCoreFunction=NULL, programInitReason=IR_PROGRAM, programUninitReason=UR_CHARTCLOSE, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_CHARTCLOSE, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=2, unchangedBars=27587, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=0x07210C88, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=NULL, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07330998)
* --- indicator unloaded -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* 07:30:06.905 SyncMainContext_deinit(304) 07210C88 TestExpert UR_UNDEFINED ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_START, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_START, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08EDD9D8, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07210C88)
* 07:30:06.905 SyncMainContext_deinit(325) 07210C88 TestExpert UR_UNDEFINED ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_DEINIT, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08EDD9D8, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07210C88)
* 07:30:06.905 LeaveContext(743) 07210C88 TestExpert ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=CF_DEINIT, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_EXPERT, moduleName="TestExpert", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08EDD9D8, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07210C88)
* 07:30:06.905 SyncLibContext_deinit(692) 07210248 rsfLib1 UR_UNDEFINED ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_INIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08EDD9D8, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07210248)
* 07:30:06.905 SyncLibContext_deinit(713) 07210248 rsfLib1 UR_UNDEFINED ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08EDD9D8, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07210248)
* 07:30:06.905 LeaveContext(743) 07210248 rsfLib1 ec={pid=3, previousPid=1, programType=PT_EXPERT, programName="TestExpert", programCoreFunction=NULL, programInitReason=IR_USER, programUninitReason=UR_UNDEFINED, programInitFlags=0, programDeinitFlags=0, moduleType=MT_LIBRARY, moduleName="rsfLib1", moduleCoreFunction=CF_DEINIT, moduleUninitReason=UR_UNDEFINED, moduleInitFlags=0, moduleDeinitFlags=0, symbol="GBPUSD", timeframe=PERIOD_M15, digits=5, point=1e-005, rates=0x0C530020, bars=27589, changedBars=-1, unchangedBars=-1, ticks=1824, cycleTicks=1824, lastTickTime="2018.01.26 23:45:00", prevTickTime="2018.01.26 23:30:00", bid=1.41531, ask=1.41541, superContext=NULL, threadId=2352 (non-UI), hChart=NULL, hChartWindow=NULL, test=0x08EDD9D8, testing=TRUE, visualMode=FALSE, optimization=FALSE, extReporting=FALSE, recordEquity=FALSE, mqlError=0, dllError=0, dllWarning=0, logging=FALSE, customLogFile=""} (0x07210248)
* --- end of test: expert unloaded -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*/
/**
* Core function call order on loading/unloading of MQL libraries
* ==============================================================
*
* When already loaded libraries are reloaded they may or may not keep state depending on the reason for reloading. States
* and core function call order during reloading are as follows:
*
* (1) Libraries loaded by indicators are reloaded during the indicator's regular init cycle (UR_CHARTCHANGE) and keep state.
*
* Single indicator with nested library calls:
* --- first load -------------------------------------------------------------------------------------------------------
* Indicator::init() UR_UNDEFINED pid=0 create new context chain set pid=1
* Indicator::LibraryA::init() UR_UNDEFINED pid=0 loaded by indicator set pid=1
* Indicator::LibraryB::init() UR_UNDEFINED pid=0 loaded by indicator set pid=1
* Indicator::LibraryC::init() UR_UNDEFINED pid=0 loaded by libraryA set pid=1
* --- deinit() ---------------------------------------------------------------------------------------------------------
* Indicator::deinit() UR_CHARTCHANGE pid=1 indicator first
* Indicator::LibraryA::deinit() UR_UNDEFINED pid=1 bug: global strings are already destroyed
* Indicator::LibraryC::deinit() UR_UNDEFINED pid=1 hierarchical (not in original loading order)
* Indicator::LibraryB::deinit() UR_UNDEFINED pid=1
* --- init() ----------------------------------- libraries keep state, indicators don't --------------------------------
* Indicator::LibraryA::init() UR_UNDEFINED pid=1
* Indicator::LibraryC::init() UR_UNDEFINED pid=1 hierarchical (not in original loading order)
* Indicator::LibraryB::init() UR_UNDEFINED pid=1
* Indicator::init() UR_CHARTCHANGE pid=0 indicator last (no state) restore pid=1
* ----------------------------------------------------------------------------------------------------------------------
*
* Multiple indicators with simple library calls:
* --- first load -------------------------------------------------------------------------------------------------------
* IndicatorA::init() UR_UNDEFINED pid=0 create new context chain set pid=1
* IndicatorA::Library::init() UR_UNDEFINED pid=0 set pid=1
* IndicatorB::init() UR_UNDEFINED pid=0 create new context chain set pid=2
* IndicatorB::Library::init() UR_UNDEFINED pid=0 set pid=2
* --- deinit() ---------------------------------------------------------------------------------------------------------
* IndicatorA::deinit() UR_CHARTCHANGE pid=1
* IndicatorA::Library::deinit() UR_UNDEFINED pid=1 bug: global strings are already destroyed
* IndicatorB::deinit() UR_CHARTCHANGE pid=2
* IndicatorB::Library::deinit() UR_UNDEFINED pid=2
* --- init() ----------------------------------- libraries keep state, indicators don't --------------------------------
* IndicatorA::Library::init() UR_UNDEFINED pid=1
* IndicatorA::init() UR_CHARTCHANGE pid=0 first indicator (no state) restore pid=1
* IndicatorB::Library::init() UR_UNDEFINED pid=2
* IndicatorB::init() UR_CHARTCHANGE pid=0 second indicator (no state) restore pid=2
* ----------------------------------------------------------------------------------------------------------------------
*
*
* (2) Libraries loaded by experts are not reloaded during the expert's regular init cycle (UR_CHARTCHANGE).
*
*
* (3) Libraries loaded by experts in tester are reloaded between multiple tests of the same strategy and keep state. In newer
* terminals (since when exactly?) this happens only if the test was not explicitly stopped by using the "Stop" button.
* In older terminals (e.g. build 500) this happens for all such tests.
*
* Expert in tester with simple library calls:
* --- Tester Start -----------------------------------------------------------------------------------------------------
* Expert::init() UR_UNDEFINED pid=0 create new context chain set pid=1
* Expert::Library::init() UR_UNDEFINED pid=0 set pid=1
* --- Tester Stop ------------------------------------------------------------------------------------------------------
* Expert::deinit() UR_UNDEFINED pid=1
* Expert::Library::deinit() UR_UNDEFINED pid=1 bug: global strings are already destroyed
* --- Tester Start ----------------------------- libraries keep state --------------------------------------------------
* Expert::Library::init() UR_UNDEFINED pid=1 state of the finished test set pid=2 set previousPid=1
* Expert::init() UR_UNDEFINED pid=0 set pid=2 set previousPid=1
* ----------------------------------------------------------------------------------------------------------------------
*
* The terminal implementation is considered broken by design. On start of a test libraries should always be in a clean
* state. Instead reloaded libraries keep state of the previously finished test, specifically:
* - Global variables are not reset and contain old values (except strings).
* - The last selected order context is not reset and order functions return wrong results.
* - The flag IsVisualMode() is not reset and may show wrong values, even if symbol or timeframe of the new test differ.
*
* Workaround: On start of a test reused libraries need to be reset manually:
* - SyncLibContext_init() removes a library from the previously finished test's context chain and attaches it to the
* context chain of the new test.
* - MQL::core/library::init() resets a previously selected order context.
* - Global array variables must be reset by implementing Library.ResetGlobalVars().
* - The MQL function IsVisualMode() must not be used, instead use the corresponding flag in the execution context.
*
*
* (4) After recompilation libraries are reloaded and don't keep state. In tester reloading can happen at the end of the
* current or on start of the next test. Reloading is always executed by the UI thread.
* Terminal bug: In online charts without a server connection reloading after unloading may not happen. An indicator or
* expert will crash the next time it tries to call a function of a still unloaded library. In this case
* the terminal log will show the message "Indicator/Expert stopped."
*
*/// (prevent Visual Assist from merging above block in the hover tooltip of below function)
/**
* Initialize and synchronize an MQL program's execution context with the master context stored in this DLL. Called by the
* init() functions of the MQL main modules. For a general overview see type EXECUTION_CONTEXT.
*
* @param EXECUTION_CONTEXT* ec - an MQL program's main module execution context
* @param ProgramType programType - program type
* @param char* programName - program name (with or without filepath depending on the terminal version)
* @param UninitializeReason uninitReason - value of UninitializeReason() as returned by the terminal
* @param DWORD initFlags - program init configuration
* @param DWORD deinitFlags - program deinit configuration
* @param char* symbol - current chart symbol
* @param uint timeframe - current chart timeframe
* @param uint digits - the current symbol's "Digits" value (possibly incorrect)
* @param double point - the current symbol's "Point" value (possibly incorrect)
* @param BOOL extReporting - value of an Expert's input parameter "EA.ExtReporting"
* @param BOOL recordEquity - value of an Expert's input parameter "EA.RecordEquity"
* @param BOOL isTesting - value of IsTesting() as returned by the terminal (possibly incorrect)
* @param BOOL isVisualMode - value of IsVisualMode() as returned by the terminal (possibly incorrect)
* @param BOOL isOptimization - value of IsOptimzation() as returned by the terminal
* @param EXECUTION_CONTEXT* sec - super context as managed by the terminal (memory possibly already released)
* @param HWND hChart - value of WindowHandle() as returned by the terminal (possibly not yet set)
* @param int droppedOnChart - value of WindowOnDropped() as returned by the terminal (possibly incorrect)
* @param int droppedOnPosX - value of WindowXOnDropped() as returned by the terminal (possibly incorrect)
* @param int droppedOnPosY - value of WindowYOnDropped() as returned by the terminal (possibly incorrect)
*
* @return int - error status
*
* @see additional notes at the top of this file
*/
int WINAPI SyncMainContext_init(EXECUTION_CONTEXT* ec, ProgramType programType, const char* programName, UninitializeReason uninitReason, DWORD initFlags, DWORD deinitFlags, const char* symbol, uint timeframe, uint digits, double point, BOOL extReporting, BOOL recordEquity, BOOL isTesting, BOOL isVisualMode, BOOL isOptimization, EXECUTION_CONTEXT* sec, HWND hChart, int droppedOnChart, int droppedOnPosX, int droppedOnPosY) {
if ((uint)ec < MIN_VALID_POINTER) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter ec: 0x%p (not a valid pointer)", ec)));
if ((uint)programName < MIN_VALID_POINTER) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter programName: 0x%p (not a valid pointer)", programName)));
if (strlen(programName) >= sizeof(ec->programName)) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "illegal length of parameter programName: \"%s\" (max %d characters)", programName, sizeof(ec->programName)-1)));
if ((uint)symbol < MIN_VALID_POINTER) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter symbol: 0x%p (not a valid pointer)", symbol)));
if (strlen(symbol) >= MAX_SYMBOL_LENGTH) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "illegal length of parameter symbol: \"%s\" (max %d characters)", symbol, MAX_SYMBOL_LENGTH)));
if ((int)timeframe <= 0) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter timeframe: %d", (int)timeframe)));
if ((int)digits < 0) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter digits: %d", (int)digits)));
if (sec && (uint)sec < MIN_VALID_POINTER) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter sec: 0x%p (not a valid pointer)", sec)));
if (ec->pid) SetLastThreadProgram(ec->pid); // set the currently executed program asap (error handling)
//debug(" %p %-13s %-14s ec=%s", ec, programName, UninitializeReasonToStr(uninitReason), EXECUTION_CONTEXT_toStr(ec));
uint currentPid = ec->pid;
BOOL isPid = (currentPid);
uint previousPid = NULL; // pid of a previous program instance (if any)
EXECUTION_CONTEXT* master = NULL;
// fix an unset chart handle (older terminals)
if (!hChart) hChart = FindWindowHandle(hChart, sec, (ModuleType)programType, symbol, timeframe, isTesting, isVisualMode);
if (hChart == INVALID_HWND) return(ERR_RUNTIME_ERROR);
// resolve the real InitReason
InitializeReason initReason = GetInitReason(ec, sec, programType, programName, uninitReason, symbol, isTesting, isVisualMode, hChart, droppedOnChart, droppedOnPosX, droppedOnPosY, previousPid);
if (!initReason) return(ERR_RUNTIME_ERROR);
if (initReason == IR_TERMINAL_FAILURE) return(_int(ERR_TERMINAL_INIT_FAILURE, debug("%s ProgramInitReason=IR_TERMINAL_FAILURE", programName)));
// (1) if ec.pid is not set: check if an indicator to be reused or something else
// - indicator in init cycle (UI thread) => reuse the previous program and keep instance data
// - indicator in IR_PROGRAM_AFTERTEST (UI thread) => reuse the previous program and keep instance data
// - indicator after recompilation (UI thread) => reuse the previous program and keep instance data
// - something else: new indicator|expert|script
// (2) update main and master context
// (3) synchronize loaded libraries
if (!isPid) {
if (programType==PT_INDICATOR && previousPid) { // reuse the previous program chain and keep instance data
currentPid = previousPid;
SetLastThreadProgram(currentPid); // set the currently executed program asap (error handling)
master = (*g_mqlPrograms[currentPid])[0];
if (initReason == IR_PROGRAM_AFTERTEST)
master->superContext = sec = NULL; // reset the super context (the expert has already been released)
*ec = *master; // restore main from master context (restores the pid)
(*g_mqlPrograms[currentPid])[1] = ec; // store main context at original (now empty) position
}
else {
// new indicator, new expert or new script
uint lastPid = GetLastThreadProgram(); // pid of the last program executed by the current thread
// if an expert in tester check for a partially initialized context chain (master!=NULL, main=NULL, lib1!=NULL)
if (programType==PT_EXPERT && isTesting && lastPid && Program_IsPartialTest(lastPid, programName)) {
currentPid = lastPid;
SetLastThreadProgram(currentPid); // set the currently executed program asap (error handling)
master = (*g_mqlPrograms[currentPid])[0];
*ec = *master; // copy master to main context
(*g_mqlPrograms[currentPid])[1] = ec; // store main context at old (empty) position
}
else {
// create a new context chain // TODO: on IR_PROGRAM_AFTERTEST somewhere exists a used context
master = new EXECUTION_CONTEXT(); // create new master context
*master = *ec; // copy main to master context
ContextChain* chain = new ContextChain();
chain->reserve(8);
chain->push_back(master); // store master and main context in a new context chain
chain->push_back(ec);
currentPid = PushProgram(chain); // store the chain and update master and main context
master->pid = ec->pid = currentPid;
SetLastThreadProgram(currentPid);
}
}
}
else {
// ec.pid is set: an expert in init cycle or any other program after a repeated init() call
master = (*g_mqlPrograms[currentPid])[0];
(*g_mqlPrograms[currentPid])[1] = ec; // store main context at old (possibly empty) position
}
// (2) update main and master context
ec_SetProgramType (ec, programType );
ec_SetProgramName (ec, programName );
ec_SetProgramCoreFunction(ec, CF_INIT ); // TODO: wrong for init() calls from start()
ec_SetProgramInitReason (ec, initReason );
ec_SetProgramUninitReason(ec, uninitReason);
ec_SetProgramInitFlags (ec, initFlags );
ec_SetProgramDeinitFlags (ec, deinitFlags );
ec_SetModuleType (ec, (ModuleType)ec->programType); // for main modules program and module values are the same
ec_SetModuleName (ec, ec->programName );
ec_SetModuleCoreFunction (ec, ec->programCoreFunction );
ec_SetModuleUninitReason (ec, ec->programUninitReason );
ec_SetModuleInitFlags (ec, ec->programInitFlags );
ec_SetModuleDeinitFlags (ec, ec->programDeinitFlags );
ec_SetSymbol (ec, symbol );
ec_SetTimeframe (ec, timeframe );
master->rates = ec->rates = NULL; // re-initialized on the next tick // TODO: may be wrong for multiple
ec_SetBars (ec, 0 ); // ... // init() calls from start()
ec_SetChangedBars (ec, -1 ); // ... // reset only on UR_CHARTCHANGE
ec_SetUnchangedBars(ec, -1 ); // ... //
//ec_SetTicks (ec, ticks ); // NULL or kept from the last init() call
master->cycleTicks = ec->cycleTicks = 0;
//ec_SetLastTickTime (ec, lastTickTime); // ...
//ec_SetPrevTickTime (ec, prevTickTime); // ...
//ec_SetBid (ec, bid ); // ...
//ec_SetAsk (ec, ask ); // ...
ec_SetDigits (ec, digits); // TODO: fix terminal bug
ec_SetPipDigits (ec, digits & (~1));
ec_SetSubPipDigits (ec, ec->pipDigits + 1);
ec_SetPip (ec, round(1./pow(10., (int)ec->pipDigits), ec->pipDigits));
ec_SetPoint (ec, point);
ec_SetPipPoints (ec, (uint)round(pow(10., (int)(digits & 1))));
master->pipPriceFormat = ec->pipPriceFormat = strformat(".%d", ec->pipDigits);
master->subPipPriceFormat = ec->subPipPriceFormat = strformat("%s'", ec->pipPriceFormat);
master->priceFormat = ec->priceFormat = (ec->digits==ec->pipDigits) ? ec->pipPriceFormat : ec->subPipPriceFormat;
ec_SetSuperContext (ec, sec );
ec_SetThreadId (ec, GetCurrentThreadId());
ec_SetHChart (ec, hChart ); // chart handles must be set before test values
ec_SetHChartWindow (ec, hChart ? GetParent(hChart) : NULL);
master->test = ec->test = Expert_InitTest(ec, isTesting);
ec_SetTesting (ec, isTesting =Program_IsTesting (ec, isTesting ));
ec_SetVisualMode (ec, isVisualMode =Program_IsVisualMode (ec, isVisualMode ));
ec_SetOptimization (ec, isOptimization=Program_IsOptimization(ec, isOptimization));
ec_SetExtReporting (ec, extReporting);
ec_SetRecordEquity (ec, recordEquity);
ec_SetLogging (ec, Program_IsLogging (ec)); // TODO: atm an empty stub defaulting to TRUE
ec_SetCustomLogFile(ec, Program_CustomLogFile(ec)); // TODO: atm an empty stub defaulting to NULL
// TODO: reset errors if not in an init() call from start()
//ec->mqlError = NULL;
//ec->dllError = NULL;
//ec->dllWarning = NULL;
//ec->dllErrorMsg = NULL;
//ec->dllWarningMsg = NULL;
// (3) synchronize loaded libraries
ContextChain& chain = *g_mqlPrograms[currentPid];
uint size = chain.size();
EXECUTION_CONTEXT *lib, bak;
for (uint i=2; i < size; ++i) { // skip master and main context
if (lib = chain[i]) {
bak = *lib; // backup the library context
*lib = *master; // overwrite library with master context
lib->moduleType = bak.moduleType; // keep library-specific values
strcpy(lib->moduleName, bak.moduleName);
lib->moduleCoreFunction = bak.moduleCoreFunction;
lib->moduleUninitReason = bak.moduleUninitReason;
lib->moduleInitFlags = bak.moduleInitFlags;
lib->moduleDeinitFlags = bak.moduleDeinitFlags;
}
else warn(ERR_ILLEGAL_STATE, "no module context found at chain[%d]: NULL main=%s", i, EXECUTION_CONTEXT_toStr(ec));
}
//debug(" %p %-13s %-14s ec=%s", ec, programName, UninitializeReasonToStr(uninitReason), EXECUTION_CONTEXT_toStr(ec));
return(NO_ERROR);
#pragma EXPANDER_EXPORT
}
/**
* @param EXECUTION_CONTEXT* ec - main module context of a program
* @param void* rates - price history of the chart
* @param int bars - current amount of price bars (chart history)
* @param int changedBars - current amount of changed indicator values
* @param uint ticks - number of received ticks, i.e. calls of MQL::start()
* @param datetime time - server time of the current tick
* @param double bid - bid price of the current tick
* @param double ask - ask price of the current tick
*
* @return int - error status
*
* @see additional notes at the top of this file
*/
int WINAPI SyncMainContext_start(EXECUTION_CONTEXT* ec, const void* rates, int bars, int changedBars, uint ticks, datetime time, double bid, double ask) {
if ((uint)ec < MIN_VALID_POINTER) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter ec: 0x%p (not a valid pointer)", ec)));
if (!ec->pid) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid execution context (ec.pid=0): thread=%d %s ec=%s", GetCurrentThreadId(), (IsUIThread() ? "(UI)":"(non-UI)"), EXECUTION_CONTEXT_toStr(ec))));
SetLastThreadProgram(ec->pid); // set the currently executed program asap (error handling)
int unchangedBars = changedBars==-1 ? -1 : bars-changedBars;
uint cycleTicks = ec->cycleTicks + 1;
datetime lastTickTime = ec->lastTickTime; if (time < lastTickTime) return(_int(ERR_ILLEGAL_STATE, error(ERR_ILLEGAL_STATE, "ticktime is counting backwards: time=%s lastTickTime=%s ec=%s", GmtTimeFormat(time, "%Y.%m.%d %H:%M:%S"), GmtTimeFormat(lastTickTime, "%Y.%m.%d %H:%M:%S"), EXECUTION_CONTEXT_toStr(ec))));
DWORD threadId = GetCurrentThreadId();
BOOL logging = ec->logging;
ContextChain& chain = *g_mqlPrograms[ec->pid];
uint size = chain.size();
EXECUTION_CONTEXT* ctx;
// update context values of all modules
for (uint i=0; i < size; ++i) {
if (ctx = chain[i]) {
ctx->programCoreFunction = CF_START; if (i < 2)
ctx->moduleCoreFunction = ctx->programCoreFunction; // in master and main context only
ctx->rates = rates;
ctx->bars = bars;
ctx->changedBars = changedBars;
ctx->unchangedBars = unchangedBars;
ctx->ticks = ticks;
ctx->cycleTicks = cycleTicks;
ctx->prevTickTime = lastTickTime;
ctx->lastTickTime = time;
ctx->bid = bid;
ctx->ask = ask;
ctx->threadId = threadId;
ctx->logging = logging; // As long as ec.logging is configured after SyncMainContext_init()
} // the flag needs to be synchronized on each tick.
else warn(ERR_ILLEGAL_STATE, "no module context found at chain[%d]: NULL main=%s", i, EXECUTION_CONTEXT_toStr(ec));
}
if (ec->test) {
// update statistics for maxRunup/maxDrawdown calculations
if ((uint)rates < MIN_VALID_POINTER) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter rates: 0x%p (not a valid pointer)", rates)));
if (bars <= 0) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter bars: %d", bars)));
TEST* test = ec->test;
OrderList* positions = test->openPositions;
double high, low;
if (positions->size()) {
switch (test->barModel) {
case BARMODEL_BAROPEN: {
datetime barTime = iTime(rates, bars, 0);
uint bar = (time == barTime); // use the closed [1] or the current bar [0] for stats
high = iHigh(rates, bars, bar); // (the last tick of a BarOpen test can be a BarClose tick)
low = iLow (rates, bars, bar);
break;
}
case BARMODEL_CONTROLPOINTS:
case BARMODEL_EVERYTICK:
high = low = bid;
break;
}
for (OrderList::iterator it=positions->begin(), end=positions->end(); it!=end; ++it) {
ORDER* order = *it;
if (high > order->high) order->high = high;
if (low < order->low ) order->low = low; // explicite for max. performance
}
}
}
//if (ec->cycleTicks == 1) debug(" %p %-13s %-14s ec=%s", ec, ec->programName, "", EXECUTION_CONTEXT_toStr(ec));
return(NO_ERROR);
#pragma EXPANDER_EXPORT
}
/**
* Update a main module's execution context before the module is unloaded. Called only from the core function Module::deinit().
* After deinit() is left the module is unloaded and it's memory must not be accessed until the module re-enters the core
* function Module::init(). If the module is an expert and the expert is reloaded (UR_CHARTCHANGE in an online chart) the
* module keeps state.
*
* @param EXECUTION_CONTEXT* ec - main module execution context
* @param UninitializeReason uninitReason - uninitialize reason as passed by the terminal
*
* @return int - error status
*
* @see additional notes at the top of this file
*/
int WINAPI SyncMainContext_deinit(EXECUTION_CONTEXT* ec, UninitializeReason uninitReason) {
if ((uint)ec < MIN_VALID_POINTER) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter ec: 0x%p (not a valid pointer)", ec)));
if (!ec->pid) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid execution context (ec.pid=0): uninitReason=%s thread=%d %s ec=%s", UninitializeReasonToStr(uninitReason), GetCurrentThreadId(), (IsUIThread() ? "(UI)":"(non-UI)"), EXECUTION_CONTEXT_toStr(ec))));
//debug("%p %-13s %-14s ec=%s", ec, ec->programName, UninitializeReasonToStr(uninitReason), EXECUTION_CONTEXT_toStr(ec));
SetLastThreadProgram(ec->pid); // set the currently executed program asap (error handling)
ContextChain& chain = *g_mqlPrograms[ec->pid];
uint size = chain.size();
DWORD threadId = GetCurrentThreadId();
EXECUTION_CONTEXT* ctx;
// update values of all modules
for (uint i=0; i < size; ++i) {
if (ctx = chain[i]) {
ctx->programCoreFunction = CF_DEINIT; if (i < 2)
ctx->moduleCoreFunction = ctx->programCoreFunction; // in master and main context only
ctx->programUninitReason = uninitReason; if (i < 2)
ctx->moduleUninitReason = ctx->programUninitReason; // in master and main context only
ctx->threadId = threadId;
}
else warn(ERR_ILLEGAL_STATE, "no module context found at chain[%d]: %p main=%s", i, chain[i], EXECUTION_CONTEXT_toStr(ec));
}
//debug("%p %-13s %-14s ec=%s", ec, ec->programName, UninitializeReasonToStr(uninitReason), EXECUTION_CONTEXT_toStr(ec));
return(NO_ERROR);
#pragma EXPANDER_EXPORT
}
/**
* Synchronize a library's EXECUTION_CONTEXT with the context of the program's main module. Called only from the core
* function Library::init(). Initializes the library context and adds it to the program's context chain.
*
* @param EXECUTION_CONTEXT* ec - the libray's execution context
* @param UninitializeReason uninitReason - UninitializeReason as passed by the terminal (possibly incorrect)
* @param DWORD initFlags - init configuration
* @param DWORD deinitFlags - deinit configuration
* @param char* moduleName - the library's name (may contain a path depending on the terminal version)
* @param char* symbol - current chart symbol
* @param uint timeframe - current chart timeframe
* @param uint digits - the symbol's "Digits" value (possibly incorrect)
* @param double point - the symbol's "Point" value (possibly incorrect)
* @param BOOL isTesting - MQL::IsTesting()
* @param BOOL isOptimization - MQL::IsOptimization()
*
* @return int - error status
*
* @see additional notes at the top of this file
*/
int WINAPI SyncLibContext_init(EXECUTION_CONTEXT* ec, UninitializeReason uninitReason, DWORD initFlags, DWORD deinitFlags, const char* moduleName, const char* symbol, uint timeframe, uint digits, double point, BOOL isTesting, BOOL isOptimization) {
if ((uint)ec < MIN_VALID_POINTER) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter ec: 0x%p (not a valid pointer)", ec)));
if ((uint)moduleName < MIN_VALID_POINTER) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter moduleName: 0x%p (not a valid pointer)", moduleName)));
if (strlen(moduleName) >= sizeof(ec->moduleName)) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "illegal length of parameter moduleName: \"%s\" (max %d characters)", moduleName, sizeof(ec->moduleName)-1)));
if ((uint)symbol < MIN_VALID_POINTER) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter symbol: 0x%p (not a valid pointer)", symbol)));
if (strlen(symbol) > MAX_SYMBOL_LENGTH) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "illegal length of parameter symbol: \"%s\" (max %d characters)", symbol, MAX_SYMBOL_LENGTH)));
if ((int)timeframe <= 0) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter timeframe: %d", (int)timeframe)));
if ((int)digits < 0) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter digits: %d", (int)digits)));
if (point <= 0) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter point: %f", point)));
//debug(" %p %-13s %-14s ec=%s", ec, moduleName, UninitializeReasonToStr(uninitReason), EXECUTION_CONTEXT_toStr(ec));
// fix the UninitializeReason
uninitReason = FixUninitReason(ec, MT_LIBRARY, CF_INIT, uninitReason);
if ((int)uninitReason < 0) return(ERR_RUNTIME_ERROR);
// (1) if ec.pid is not set: the context is empty, check if recompilation or first-time load
// - UR_RECOMPILE: immediate reload in regular charts with connection (UI thread)
// reload on next usage in regular charts without connection (UI thread)
// immediate reload or reload after a test finished in tester
//
// - UR_UNDEFINED: first time load
//
// (2) if ec.pid is set: check if indicator in init cycle, indicator in IR_PROGRAM_AFTERTEST or reloaded expert between tests
// (2.1) indicator in init cycle or indicator in IR_PROGRAM_AFTERTEST (UI thread)
// (2.2) reloaded expert between tests (non-UI thread)
if (!ec->pid) {
// (1) recompilation or first-time load, the context is empty
if (uninitReason == UR_RECOMPILE) {
if (IsUIThread()) {
// immediate reload in regular charts with connection or between tests, otherwise on next usage
uint pid = FindModuleInLimbo(MT_LIBRARY, moduleName, UR_RECOMPILE, NULL, NULL);
if (!pid) error(ERR_RUNTIME_ERROR, "UR_RECOMPILE - no %s library found in g_recompiledModule (pid=%d, type=%s, name=%s): thread=%d %s isTesting=%s", moduleName, g_recompiledModule.pid, ModuleTypeToStr(g_recompiledModule.type), g_recompiledModule.name, GetCurrentThreadId(), IsUIThread() ? "(UI)":"(non-UI)", BoolToStr(isTesting));
else {
SetLastThreadProgram(pid);
g_recompiledModule = RECOMPILED_MODULE(); // reset recompilation tracker
*ec = *(*g_mqlPrograms[pid])[0]; // initialize library context with master context
ec->moduleType = MT_LIBRARY; // update library specific values
strcpy(ec->moduleName, moduleName);
ec->moduleCoreFunction = CF_INIT;
ec->moduleUninitReason = uninitReason;
ec->moduleInitFlags = initFlags;
ec->moduleDeinitFlags = deinitFlags;
ec->mqlError = NULL; // reset errors
ec->dllError = NULL;
ec->dllWarning = NULL;
ec->dllErrorMsg = NULL;
ec->dllWarningMsg = NULL;
g_mqlPrograms[pid]->push_back(ec); // add context to the program's context chain
}
}
else {
// Library::init() of a formerly recompiled library at test start (non-UI thread), Expert::init() is called afterwards
// check if a partially initialized context chain exists (master->coreFunction=CF_INIT, main=NULL)
EXECUTION_CONTEXT* master; // master of current test
uint currentPid = GetLastThreadProgram(); // pid of the current test
BOOL isPartialChain;
if (!currentPid) { // first library in init cyle: the thread never executed a program
isPartialChain = FALSE;
}
else { // get the last executed program: it's myself or something else
ContextChain& chain = *g_mqlPrograms[currentPid]; // if partial chain found it's myself and another library with UR_RECOMPILE (which never gets reset)
isPartialChain = (chain.size()>2 && (master=chain[0]) && chain[0]->programCoreFunction==CF_INIT && !chain[1]);
if (!isPartialChain) warn(ERR_ILLEGAL_STATE, "unexpected library with UR_RECOMPILE in tester: a former library (pid=%d) seems to not have created a partial context chain");
}
if (!isPartialChain) {
// create a new partially initialized chain
master = new EXECUTION_CONTEXT(); // create new master context
ContextChain* chain = new ContextChain();
chain->reserve(8);
chain->push_back(master); // add master to a new chain
chain->push_back(NULL); // add empty entry for the yet to come main context
currentPid = PushProgram(chain); // store the chain
uint threadIndex = SetLastThreadProgram(currentPid);
master->pid = currentPid; // update master context with the known values
master->programType = PT_EXPERT;
master->moduleType = MT_EXPERT;
strcpy(master->symbol, symbol); // first moment a new symbol/timeframe show up
master->timeframe = timeframe;
master->digits = digits; // TODO: fix terminal bug
master->pipDigits = digits & (~1);
master->subPipDigits = master->pipDigits + 1;
master->pip = round(1./pow((double)10., (int)master->pipDigits), master->pipDigits);
master->point = point;
master->pipPoints = (uint)round(pow((double)10., (int)(digits & 1)));
master->pipPriceFormat = strformat(".%d", master->pipDigits);
master->subPipPriceFormat = strformat("%s'", master->pipPriceFormat);
master->priceFormat = (master->digits==master->pipDigits) ? master->pipPriceFormat : master->subPipPriceFormat;
master->superContext = FALSE;
master->threadId = g_threads[threadIndex];
master->testing = TRUE; // TODO: so wrong, we can be online and not in tester
master->optimization = isOptimization;
}
// re-initialize the empty library context with the partial master context
*ec = *master;
ec->moduleType = MT_LIBRARY; // update library specific values
strcpy(ec->moduleName, moduleName);
ec->moduleCoreFunction = CF_INIT;
ec->moduleUninitReason = uninitReason;
ec->moduleInitFlags = initFlags;
ec->moduleDeinitFlags = deinitFlags;
g_mqlPrograms[currentPid]->push_back(ec); // add library to the expert's context chain
}
}
else {
// (1.2) first time load of library, Library::init() is called after MainModule::init() in the current thread
// Initialize the library with the current program's master context.
uint pid = GetLastThreadProgram(); // the program is currently executed
if (!pid) return(_int(ERR_ILLEGAL_STATE, error(ERR_ILLEGAL_STATE, "unknown program loading library \"%s\": pid=0 UninitializeReason=%s threadId=%d (%s) ec=%s", moduleName, UninitializeReasonToStr(uninitReason), GetCurrentThreadId(), IsUIThread() ? "UI":"non-UI", EXECUTION_CONTEXT_toStr(ec))));
*ec = *(*g_mqlPrograms[pid])[0]; // initialize library context with master context
ec->moduleType = MT_LIBRARY; // update library specific values
strcpy(ec->moduleName, moduleName);
ec->moduleCoreFunction = CF_INIT;
ec->moduleUninitReason = uninitReason;
ec->moduleInitFlags = initFlags;
ec->moduleDeinitFlags = deinitFlags;
ec->mqlError = NULL; // reset errors
ec->dllError = NULL;
ec->dllWarning = NULL;
ec->dllErrorMsg = NULL;
ec->dllWarningMsg = NULL;
g_mqlPrograms[pid]->push_back(ec); // add context to the program's context chain
}
}
else if (IsUIThread()) {
// (2.1) ec.pid is set: indicator in init cycle or in IR_PROGRAM_AFTERTEST (both UI thread)
// ec.pid points to the original indicator (still in limbo), Library::init() is called before Indicator::init()
SetLastThreadProgram(ec->pid); // set the currently executed program asap (error handling)
EXECUTION_CONTEXT* master = (*g_mqlPrograms[ec->pid])[0];
if (isTesting) // indicator in IR_PROGRAM_AFTERTEST
master->programInitReason = IR_PROGRAM_AFTERTEST;
else {} // indicator in init cycle
// update known master values
strcpy(master->symbol, symbol); // first moment a new symbol/timeframe show up
master->timeframe = timeframe;
master->rates = NULL;
master->bars = 0;
master->changedBars = -1;
master->unchangedBars = -1;
master->digits = digits; // TODO: fix terminal bug
master->pipDigits = digits & (~1);
master->subPipDigits = master->pipDigits + 1;
master->pip = round(1./pow((double)10., (int)master->pipDigits), master->pipDigits);
master->point = point;
master->pipPoints = (uint)round(pow((double)10., (int)(digits & 1)));
master->pipPriceFormat = strformat(".%d", master->pipDigits);
master->subPipPriceFormat = strformat("%s'", master->pipPriceFormat);
master->priceFormat = (master->digits==master->pipDigits) ? master->pipPriceFormat : master->subPipPriceFormat;
master->superContext = NULL; // no super context at all or already released
master->threadId = GetCurrentThreadId();
master->mqlError = NO_ERROR;
master->dllError = NO_ERROR;
master->dllWarning = NO_ERROR;
master->dllErrorMsg = NULL; // TODO: release memory of existing messages
master->dllWarningMsg = NULL;
// re-initialize the library context with the updated master context
EXECUTION_CONTEXT bak = *ec; // create backup
*ec = *master; // copy master over library context
ec->moduleType = bak.moduleType; // restore library specific values
strcpy(ec->moduleName, bak.moduleName);
ec->moduleCoreFunction = CF_INIT;
ec->moduleUninitReason = uninitReason;
ec->moduleInitFlags = initFlags;
ec->moduleDeinitFlags = deinitFlags;
g_mqlPrograms[ec->pid]->push_back(ec); // re-add context to the old indicator's chain
}
else {
// (2.2) ec.pid is set: reloaded expert between tests (non-UI thread), Library::init() is called before Expert::init()
// ec.pid points to the previously finished test
if (ec->programType!=PT_EXPERT || !ec->testing) return(_int(ERR_ILLEGAL_STATE, error(ERR_ILLEGAL_STATE, "unexpected library init cycle: thread=%d (%s) ec=%s", GetCurrentThreadId(), IsUIThread()?"UI":"non-UI", EXECUTION_CONTEXT_toStr(ec))));
EXECUTION_CONTEXT* master=NULL, *oldMaster=NULL; // master of current and old test
uint currentPid = GetLastThreadProgram(); // pid of the new test
BOOL isPartialChain;
// check if a partially initialized context chain exists (master->programCoreFunction=NULL, main=NULL, lib1!=NULL)
if (!currentPid || currentPid==ec->pid) { // first library in init cyle: the thread never executed a program
isPartialChain = FALSE; // or the program is the finished test (probably in an optimization)
}
else { // get the last executed program: it's myself or something else
ContextChain& chain = *g_mqlPrograms[currentPid]; // if partial chain found, it's myself with one more re-used library
isPartialChain = (chain.size()>2 && (master=chain[0]) && !master->programCoreFunction && !chain[1]);
if (!isPartialChain) debug("unseen library init cycle in tester (the former program seems not to be the former test): ec=%s", EXECUTION_CONTEXT_toStr(ec));
}
if (!isPartialChain) {
// create a new partially initialized chain
master = new EXECUTION_CONTEXT(); // create new master context
ContextChain* chain = new ContextChain();
chain->reserve(8);
chain->push_back(master); // add master to a new chain
chain->push_back(NULL); // add empty entry for the yet to come main context
currentPid = PushProgram(chain); // store the chain
uint threadIndex = SetLastThreadProgram(currentPid);
master->pid = currentPid; // update master context with the known values
master->previousPid = ec->pid;
master->programType = ec->programType;
strcpy(master->programName, ec->programName);
master->moduleType = (ModuleType)master->programType;
strcpy(master->moduleName, master->programName);
strcpy(master->symbol, symbol); // first moment symbol/timeframe show up
master->timeframe = timeframe;
master->bars = 0;
master->changedBars = -1;
master->unchangedBars = -1;
master->digits = digits; // TODO: fix terminal bug
master->pipDigits = digits & (~1);
master->subPipDigits = master->pipDigits + 1;
master->pip = round(1./pow((double)10., (int)master->pipDigits), master->pipDigits);
master->point = point;
master->pipPoints = (uint)round(pow((double)10., (int)(digits & 1)));
master->pipPriceFormat = strformat(".%d", master->pipDigits);
master->subPipPriceFormat = strformat("%s'", master->pipPriceFormat);
master->priceFormat = (master->digits==master->pipDigits) ? master->pipPriceFormat : master->subPipPriceFormat;
master->threadId = g_threads[threadIndex];
master->testing = TRUE;
master->optimization = isOptimization;
}
// re-initialize the library context with the master context
EXECUTION_CONTEXT bak = *ec; // create backup
*ec = *master; // overwrite library with new master context
ec->moduleType = bak.moduleType; // keep library specific values
strcpy(ec->moduleName, bak.moduleName);
ec->moduleCoreFunction = CF_INIT;
ec->moduleUninitReason = uninitReason;
ec->moduleInitFlags = initFlags;
ec->moduleDeinitFlags = deinitFlags;
g_mqlPrograms[currentPid]->push_back(ec); // add library to the new test's context chain
}
//debug(" %p %-13s %-14s ec=%s", ec, moduleName, UninitializeReasonToStr(uninitReason), EXECUTION_CONTEXT_toStr(ec));
return(NO_ERROR);
#pragma EXPANDER_EXPORT
}
/**
* Update a library's execution context before the library gets unloaded. Called only from the core function Library::deinit().
* Depending on the current runtime situation the library may or may not keep state.
*
* @param EXECUTION_CONTEXT* ec
* @param UninitializeReason uninitReason - UninitializeReason as passed by the terminal (possibly incorrect)
*
* @return int - error status
*
* @see additional notes at the top of this file
*/
int WINAPI SyncLibContext_deinit(EXECUTION_CONTEXT* ec, UninitializeReason uninitReason) {
if ((uint)ec < MIN_VALID_POINTER) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter ec: 0x%p (not a valid pointer)", ec)));
if (!ec->pid) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid execution context (ec.pid=0): uninitReason=%s thread=%d (%s) ec=%s", UninitializeReasonToStr(uninitReason), GetCurrentThreadId(), IsUIThread() ? "UI":"non-UI", EXECUTION_CONTEXT_toStr(ec))));
//debug(" %p %-13s %-14s ec=%s", ec, ec->moduleName, UninitializeReasonToStr(uninitReason), EXECUTION_CONTEXT_toStr(ec));
SetLastThreadProgram(ec->pid); // set the currently executed program asap (error handling)
// try to fix the UninitializeReason
uninitReason = FixUninitReason(ec, MT_LIBRARY, CF_DEINIT, uninitReason);
if ((int)uninitReason < 0) return(ERR_RUNTIME_ERROR);
ec->moduleCoreFunction = CF_DEINIT; // update library specific values
ec->moduleUninitReason = uninitReason;
ContextChain& chain = *g_mqlPrograms[ec->pid];
uint size = chain.size();
DWORD threadId = GetCurrentThreadId();
for (uint i=0; i < size; ++i) { // update values of all modules
if (EXECUTION_CONTEXT* ctx = chain[i]) {
ctx->threadId = threadId;
}
}
//debug(" %p %-13s %-14s ec=%s", ec, ec->moduleName, UninitializeReasonToStr(uninitReason), EXECUTION_CONTEXT_toStr(ec));
return(NO_ERROR);
#pragma EXPANDER_EXPORT
}
/**
* Handle leaving of an MQL module's core function Module::deinit(). Called in deinit() as the very last statement. After
* deinit() is left the module is unloaded and it's memory must not be accessed anymore.
*
* - If the module is a main module (an indicator, expert or script) the index of the context in the program's context chain
* is set to NULL (the chain size doesn't change).
*
* - If the module is not a main module (a library) the context is removed from the program's context chain (the chain size
* decreases).
*
* - TODO:
* When a program's last library is unloaded and the program is not reloaded (on UR_REMOVE, UR_TEMPLATE, UR_CHARTCLOSE,
* UR_CLOSE, UR_RECOMPILE) the program may be removed from the list of known programs >> if it's the last one <<.
*
* - If an expert is reloaded (on UR_CHARTCHANGE) the expert's main module keeps state.
*
* An unloaded module's memory must not be accessed until the module re-enters the core function Module::init().
*
* @param EXECUTION_CONTEXT* ec
*
* @return int - error status
*/
int WINAPI LeaveContext(EXECUTION_CONTEXT* ec) {
if ((uint)ec < MIN_VALID_POINTER) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid parameter ec: 0x%p (not a valid pointer)", ec)));
//debug(" %p %-13s %-14s ec=%s", ec, ec->moduleName, "", EXECUTION_CONTEXT_toStr(ec));
if (!ec->pid) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid execution context (ec.pid=0): thread=%d (%s) ec=%s", GetCurrentThreadId(), IsUIThread() ? "UI":"non-UI", EXECUTION_CONTEXT_toStr(ec))));
if (ec->moduleCoreFunction != CF_DEINIT) return(_int(ERR_INVALID_PARAMETER, error(ERR_INVALID_PARAMETER, "invalid execution context (ec.moduleCoreFunction not CF_DEINIT): thread=%d (%s) ec=%s", GetCurrentThreadId(), IsUIThread() ? "UI":"non-UI", EXECUTION_CONTEXT_toStr(ec))));
if (g_mqlPrograms.size() <= ec->pid) return(_int(ERR_ILLEGAL_STATE, error(ERR_ILLEGAL_STATE, "illegal list of ContextChains (size=%d) for pid=%d: ec=%s", g_mqlPrograms.size(), ec->pid, EXECUTION_CONTEXT_toStr(ec))));
ContextChain& chain = *g_mqlPrograms[ec->pid];
uint chainSize = chain.size();
if (chain.size() < 2) return(_int(ERR_ILLEGAL_STATE, error(ERR_ILLEGAL_STATE, "illegal context chain (size=%d): ec=%s", chainSize, EXECUTION_CONTEXT_toStr(ec))));
switch (ec->moduleType) {
// -----------------------------------------------------------------
case MT_INDICATOR:
case MT_SCRIPT:
case MT_EXPERT: