-
Notifications
You must be signed in to change notification settings - Fork 1
/
ForexComboSystem_v5.0(4in1)EURUSD.mq4
1529 lines (1499 loc) · 71.7 KB
/
ForexComboSystem_v5.0(4in1)EURUSD.mq4
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
#property copyright "http://myfxbook.3dn.ru/"
#property link "http://myfxbook.3dn.ru/"
#import "wininet.dll"
int InternetOpenA(string a0, int a1, string a2, string a3, int a4);
int InternetOpenUrlA(int a0, string a1, string a2, int a3, int a4, int a5);
int InternetReadFile(int a0, string a1, int a2, int& a3[]);
int InternetCloseHandle(int a0);
#import "FCS500.dll"
int dllInit(int a0, int a1, int a2, int a3, int a4);
int dllOpenCond1(int a0, double a1, double a2, double a3, double a4, double a5, double a6, int a7, int a8, int a9);
int dllCloseCond1(int a0, double a1, double a2);
int dllOpenCond2(int a0, double a1, double a2, double a3, double a4, double a5, double a6);
int dllCloseCond2(int a0, double a1, double a2, double a3, double a4);
int dllOpenCond3(int a0, double a1, double a2, double a3, double a4, double a5, double a6);
int dllCloseCond3(int a0, double a1, double a2, double a3, double a4, double a5, double a6);
int dllOpenCond4(int a0, int a1, int a2, int a3, double a4, double a5, double a6, double a7, double a8, double a9);
int dllCloseCond4(int a0, double a1, double a2, double a3, double a4);
int dllParamInit1(int a0);
int dllParamInit2(int a0);
double dllExpTrailLong(double a0, double a1, double a2);
double dllExpTrailShort(double a0, double a1, double a2);
int dllGMTOffset();
#import
//string gs_76 = "http://forex-combo.com/verify4in1.php";
bool gi_84 = FALSE;
extern string A = "====================";
extern bool Use_FXCOMBO_Scalping = TRUE;
extern bool Use_FXCOMBO_Breakout = TRUE;
extern bool Use_FXCOMBO_Reversal = TRUE;
extern bool Use_FXCOMBO_EuroRange = TRUE;
extern string B = "====================";
extern bool Use_ECN_Execution = TRUE;
extern bool Hidden_StopAndTarget = FALSE;
extern bool No_Hedge_Trades = FALSE;
extern bool NFA_Compatibility = FALSE;
extern string C = "====================";
extern string CommentSys1 = "*** 1 ***";
extern string CommentSys2 = "*** 2 ***";
extern string CommentSys3 = "*** 3 ***";
extern string CommentSys4 = "*** 4 ***";
extern string D = "====================";
extern int Magic1 = 111;
extern int Magic2 = 222;
extern int Magic3 = 333;
extern int Magic4 = 444;
extern string E = "====================";
extern double MaxSPREAD = 4.0;
extern int Slippage = 2;
extern bool AutoGMT_Offset = TRUE;
extern int ManualGMT_Offset = 2;
extern bool Calculate_DST = TRUE;
extern bool UseAgresiveMM = FALSE;
extern bool EMAIL_Notification = FALSE;
extern string MMSys1 = "==== FXCOMBO Scalping MM Parameters ====";
extern double LotsSys1 = 0.1;
extern double TradeMMSys1 = 0.0;
extern double LossFactorSys1 = 2.0;
int gi_272 = 0;
int gi_276 = 2;
int gi_280 = 0;
extern string MMSys2 = "==== FXCOMBO Breakout MM Parameters ====";
extern double LotsSys2 = 0.1;
extern double TradeMMSys2 = 0.0;
extern double LossFactorSys2 = 2.0;
int gi_316 = 0;
int gi_320 = 2;
int gi_324 = 0;
extern string MMSys3 = "==== FXCOMBO Reversal MM Parameters ====";
extern double LotsSys3 = 0.1;
extern double TradeMMSys3 = 0.0;
extern double LossFactorSys3 = 2.0;
int gi_360 = 0;
int gi_364 = 2;
int gi_368 = 0;
extern string MMSys4 = "==== FXCOMBO EuroRange MM Parameters ====";
extern double LotsSys4 = 0.1;
extern double TradeMMSys4 = 0.0;
extern double LossFactorSys4 = 2.0;
int gi_404 = 0;
int gi_408 = 2;
int gi_412 = 0;
extern string CommonMM = "==== Main MM Parameters ====";
extern double MMMax = 20.0;
extern double MaximalLots = 50.0;
extern string Scalping = "==== FXCOMBO Scalping System Parameters ====";
extern int StopLoss = 40;
extern int TakeProfit = 19;
int g_period_456 = 60;
extern int TREND_STR = 24;
int g_period_464 = 11;
extern int OSC_open = 5;
extern int OSC_close = 14;
int gi_476 = -5;
int gi_480 = -1;
int gi_484 = -1;
int gi_488 = 6;
extern string Breakout = "==== FXCOMBO Breakout System Parameters ====";
extern int TakeProfit_II = 70;
extern int StopLoss_II = 34;
extern int MaxPipsTrailing2 = 45;
extern int MinPipsTrailing2 = 10;
extern int Break = 6;
int g_period_520 = 1;
int g_period_524 = 19;
double gd_528 = 1.45;
extern double ATRTrailingFactor2 = 1.15;
int gi_544 = 300;
extern int F_TrailingProfit_II = 40;
extern int F_Trailing_II = 30;
extern bool Use_Exp_Trailing_II = FALSE;
extern double Exp_Trail_Factor_II = 0.16;
int gi_568 = 30;
int gi_572 = 45;
int gi_576 = 0;
int gi_580 = 3;
int gi_584 = 0;
int gi_588 = 19;
int gi_592 = 14;
int gi_596 = 17;
int gi_600 = 20;
int gi_604 = 9;
int gi_608 = 7;
int gi_612 = 13;
int gi_616 = 8;
int gi_620 = 3;
int gi_624 = 3;
extern string Reversal = "==== FXCOMBO Reversal System Parameters ====";
extern int BegHourSys_III = 22;
extern int EndHourSys_III = 0;
extern int TakeProfit_III = 170;
extern int StopLoss_III = 70;
int gi_652 = 300;
extern int MaxPipsTrailing3 = 140;
extern int MinPipsTrailing3 = 20;
int g_period_664 = 50;
double gd_668 = 9.0;
int g_period_676 = 18;
int gi_680 = -6;
int gi_684 = 25;
extern int F_TrailingProfit_III = 160;
extern int F_Trailing_III = 20;
extern bool Use_Exp_Trailing_III = FALSE;
extern double Exp_Trail_Factor_III = 1.0;
extern string EuroRange = "==== FXCOMBO EuroRange System Parameters ====";
int gi_716 = 5;
int gi_720 = 40;
extern int MaxRangePips = 95;
extern int BreakPips = -12;
extern double TargetPercent = 5.0;
extern int StopLoss_IV = 41;
int gi_744 = 300;
int gi_748 = 100;
int gi_752 = 5;
double gd_756 = 100.0;
int gi_764 = 300;
int gi_768 = 30;
extern bool Use_Exp_Trailing_IV = TRUE;
extern double Exp_Trail_Factor_IV = 0.15;
extern int ReverseTF = 5;
extern int ExitProfit = 80;
extern string NF = "==== News Filter Settings ====";
extern bool Include_Medium_News = TRUE;
extern int Wait_Before_News = 30;
extern int Wait_After_News = 30;
extern bool NewsFilterSys1 = FALSE;
extern bool NewsFilterSys2 = FALSE;
extern bool NewsFilterSys3 = FALSE;
extern bool NewsFilterSys4 = FALSE;
string gs_828 = "";
string gs_836 = "";
string gs_844 = "";
int g_datetime_852 = 0;
bool gi_856 = TRUE;
string gs_860 = "";
string gs_868 = "";
int gi_876 = 0;
int gi_880 = -1;
double g_minlot_884 = 0.0;
double g_maxlot_892 = 0.0;
int g_leverage_900 = 0;
int g_lotsize_904 = 0;
double g_lotstep_908 = 0.0;
int g_datetime_916 = 0;
int g_datetime_920 = 0;
int g_datetime_924 = 0;
int g_datetime_928 = 0;
int gi_932;
int gi_936;
int gi_940 = 0;
int gi_944 = 1;
int gi_unused_948 = 3;
int gi_952 = 13;
int g_datetime_956 = 0;
int g_index_960 = 0;
int gia_964[1000];
string gsa_968[1000];
string gsa_972[1000];
// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
gi_856 = TRUE;
gi_84 = FALSE;
Comment("");
if (ObjectFind("klc") >= 0) ObjectDelete("klc");
if (ObjectFind("klc2") >= 0) ObjectDelete("klc2");
if (ObjectFind("klc3") >= 0) ObjectDelete("klc3");
return (0);
}
// 52D46093050F38C27267BCE42543EF60
int deinit() {
Comment("");
if (ObjectFind("klc") >= 0) ObjectDelete("klc");
if (ObjectFind("klc2") >= 0) ObjectDelete("klc2");
if (ObjectFind("klc3") >= 0) ObjectDelete("klc3");
return (0);
}
// EA2B2676C28C0DB26D39331A336C6B92
int start() {
double price_0;
double price_8;
double price_16;
color color_32;
string ls_48;
int li_56;
string ls_60;
bool bool_68;
bool bool_72;
bool bool_76;
double ld_88;
string ls_104;
int li_120;
int li_300;
int li_304;
int li_308;
int li_312;
int li_316;
int li_320;
int li_324;
int ticket_452;
int ticket_456;
int ticket_460;
int ticket_464;
double price_472;
double price_480;
double price_488;
double price_496;
double ld_504;
double price_512;
double price_520;
double price_528;
double ld_536;
double price_544;
double price_552;
double price_560;
string ls_616;
double ld_40 = 1;
if (gi_856) {
gi_856 = FALSE;
g_minlot_884 = MarketInfo(Symbol(), MODE_MINLOT);
g_maxlot_892 = MarketInfo(Symbol(), MODE_MAXLOT);
g_leverage_900 = AccountLeverage();
g_lotsize_904 = MarketInfo(Symbol(), MODE_LOTSIZE);
g_lotstep_908 = MarketInfo(Symbol(), MODE_LOTSTEP);
gi_880 = -1;
gs_828 = "";
gs_836 = "";
gs_844 = "";
g_datetime_852 = 0;
}
if ((!IsTesting()) && IsStopped()) return (0);
if ((!IsTesting()) && !IsTradeAllowed()) {
Comment("Trading server: Trading is not Allowed ...");
return (0);
}
if ((!IsTesting()) && IsTradeContextBusy()) {
Comment("Trading server: Trade Context is Busy ...");
return (0);
}
if (iATR(NULL, PERIOD_M5, 1, 1) < Point / 2.0) return (0);
if (IsDllsAllowed() == FALSE) {
Comment("Warning: Set Parameter **AllowDLL Imports** ON in menu Tools -> Options -> ExpertAdvisors.");
Print("Warning: Set Parameter **AllowDLL Imports** ON in menu Tools -> Options -> ExpertAdvisors.");
Alert("Warning: Set Parameter **AllowDLL Imports** ON in menu Tools -> Options -> ExpertAdvisors.");
Sleep(30000);
return (0);
}
gi_84 = TRUE;
/*if ((!gi_84) && !IsTesting()) {
if (IsDemo() == FALSE) ls_60 = "AccountType=2";
else ls_60 = "AccountType=1";
if (f0_11(gs_76 + "?AccountId=" + DoubleToStr(AccountNumber(), 0) + "&" + ls_60, ls_48)) {
if (StringTrimRight(StringTrimLeft(f0_10(ls_48, 0, "<result>", "</result>", li_56))) == "OK") gi_84 = TRUE;
else {
Comment("Online validation is not passed. For more information, contact us at [email protected]!");
Alert("Online validation is not passed. For more information, contact us at [email protected]!");
Sleep(30000);
return (0);
}
} else {
Comment("\n Online validation failed (error number " + DoubleToStr(GetLastError(), 0) + "). Visit www.forex-combo.com for more information!");
Alert("Online validation failed (error number " + DoubleToStr(GetLastError(), 0) + "). Visit www.forex-combo.com for more information!");
Sleep(30000);
return (0);
}
}*/
if (gi_880 <= 0) {
gi_880 = f0_23(AccountNumber(), IsTesting(), IsDemo(), WindowHandle(Symbol(), Period()), TimeCurrent());
if (IsTesting()) Calculate_DST = FALSE;
if (IsTesting() || AutoGMT_Offset == FALSE) gi_876 = ManualGMT_Offset;
if (!IsTesting() && AutoGMT_Offset == TRUE && Calculate_DST == TRUE && (Month() > 3 && Month() < 11)) gi_876 = f0_17() - 1;
if (!IsTesting() && AutoGMT_Offset == TRUE && Calculate_DST == TRUE && Month() <= 3 || Month() >= 11) gi_876 = f0_17();
if (!IsTesting() && AutoGMT_Offset == TRUE && Calculate_DST == FALSE) gi_876 = f0_17();
}
if (gi_880 <= 0 && gi_84 && (!IsTesting())) {
Comment("DLL initialization is failed (" + DoubleToStr(gi_880, 0) + "). For more information, contact us at [email protected]!");
Alert("DLL initialization is failed (" + DoubleToStr(gi_880, 0) + "). For more information, contact us at [email protected]!");
Sleep(10000);
return (0);
}
if (gi_880 <= 0 && IsTesting()) Print("DLL initialization is failed (" + DoubleToStr(gi_880, 0) + "). Please register you test account at forex-combo.com!");
int stoplevel_80 = MarketInfo(Symbol(), MODE_STOPLEVEL);
bool li_84 = TRUE;
if (stoplevel_80 == 0 || Use_ECN_Execution == TRUE || Hidden_StopAndTarget == TRUE) li_84 = FALSE;
if (Digits <= 3) ld_88 = 0.01;
else ld_88 = 0.0001;
double ld_96 = NormalizeDouble((Ask - Bid) / ld_88, 1);
if (IsTesting()) Calculate_DST = FALSE;
if (Calculate_DST == TRUE) ls_104 = "YES";
if (Calculate_DST == FALSE) ls_104 = "NO";
string ls_112 = "*** SPREAD OK ***";
if (ld_96 > MaxSPREAD) ls_112 = "*** SPREAD IS TOO HIGH ***";
if (!IsTesting()) li_120 = f0_17();
else li_120 = ManualGMT_Offset;
gs_860 = "\n\n Greenwich Mean Time : " + TimeToStr(TimeCurrent() - 3600 * li_120, TIME_DATE|TIME_MINUTES|TIME_SECONDS)
+ "\n Broker Time : " + TimeToStr(TimeCurrent(), TIME_DATE|TIME_MINUTES|TIME_SECONDS)
+ "\n Calculate DST: " + ls_104;
string ls_124 = "FX COMBO is running on your account - Validation OK";
string ls_132 = "FX COMBO is set up for time zone GMT " + gi_876;
string ls_140 = "Spread= " + DoubleToStr(ld_96, 1) + " pips";
string ls_148 = "Account Balance= " + DoubleToStr(AccountBalance(), 2);
string ls_156 = ls_112;
string ls_164 = "";
f0_2();
if (gs_836 != "") {
ls_164 = "\n"
+ gs_836;
}
ls_164 = ls_164
+ "\n\n " + gs_828;
Comment("\n\n\n\n\n " + ls_124 + " \n " + ls_132 + " \n " + ls_140 + " \n " + ls_148 + " \n\n " + ls_156 + " " + gs_860 + " " + gs_868 + ls_164);
ObjectCreate("klc", OBJ_LABEL, 0, 0, 0);
ObjectSetText("klc", " ** FOREX COMBO SYSTEM 4 in 1 **", 9, "System", Red);
ObjectSet("klc", OBJPROP_CORNER, 0);
ObjectSet("klc", OBJPROP_XDISTANCE, 0);
ObjectSet("klc", OBJPROP_YDISTANCE, 29);
ObjectCreate("klc3", OBJ_LABEL, 0, 0, 0);
ObjectSetText("klc3", " Copyright © www.fxautomater.com ", 9, "System", Gray);
ObjectSet("klc3", OBJPROP_CORNER, 0);
ObjectSet("klc3", OBJPROP_XDISTANCE, 0);
ObjectSet("klc3", OBJPROP_YDISTANCE, 45);
if (UseAgresiveMM != TRUE) {
LossFactorSys1 = 1;
LossFactorSys2 = 1;
LossFactorSys3 = 1;
LossFactorSys4 = 1;
}
HideTestIndicators(TRUE);
double iclose_172 = iClose(NULL, PERIOD_M15, 1);
double ima_180 = iMA(NULL, PERIOD_M15, g_period_456, 0, MODE_SMMA, PRICE_CLOSE, 1);
double iwpr_188 = iWPR(NULL, PERIOD_M15, g_period_464, 1);
double iatr_196 = iATR(NULL, PERIOD_H1, g_period_524, 1);
double ima_204 = iMA(NULL, PERIOD_H1, g_period_520, 0, MODE_EMA, PRICE_CLOSE, 1);
double ld_212 = ima_204 + iatr_196 * gd_528;
double ld_220 = ima_204 - iatr_196 * gd_528;
double iclose_228 = iClose(NULL, PERIOD_M5, 1);
double iatr_236 = iATR(NULL, PERIOD_M5, 5, 1);
double iatr_244 = iATR(NULL, PERIOD_M5, g_period_664, 1);
double ihigh_252 = iHigh(NULL, PERIOD_H1, 1);
double ilow_260 = iLow(NULL, PERIOD_H1, 1);
double ibands_268 = iBands(NULL, PERIOD_H1, g_period_676, 2, 0, PRICE_CLOSE, MODE_UPPER, 1);
double ibands_276 = iBands(NULL, PERIOD_H1, g_period_676, 2, 0, PRICE_CLOSE, MODE_LOWER, 1);
HideTestIndicators(FALSE);
double ihigh_284 = iHigh(NULL, PERIOD_H1, iHighest(NULL, PERIOD_H1, MODE_HIGH, gi_716, 1));
double ilow_292 = iLow(NULL, PERIOD_H1, iLowest(NULL, PERIOD_H1, MODE_LOW, gi_716, 1));
if (gi_480 < 0) f0_19(gi_480, gi_484);
if (gi_580 < 0) f0_8(gi_580, gi_584, gi_588, gi_592, gi_596, gi_600, gi_604, gi_608, gi_612, gi_616, gi_620, gi_624);
if (TakeProfit < stoplevel_80 * Point / ld_88) li_300 = stoplevel_80 * Point / ld_88;
else li_300 = TakeProfit;
if (StopLoss < stoplevel_80 * Point / ld_88) li_304 = stoplevel_80 * Point / ld_88;
else li_304 = StopLoss;
if (TakeProfit_II < stoplevel_80 * Point / ld_88) li_308 = stoplevel_80 * Point / ld_88;
else li_308 = TakeProfit_II;
if (StopLoss_II < stoplevel_80 * Point / ld_88) li_312 = stoplevel_80 * Point / ld_88;
else li_312 = StopLoss_II;
if (TakeProfit_III < stoplevel_80 * Point / ld_88) li_316 = stoplevel_80 * Point / ld_88;
else li_316 = TakeProfit_III;
if (StopLoss_III < stoplevel_80 * Point / ld_88) li_320 = stoplevel_80 * Point / ld_88;
else li_320 = StopLoss_III;
if (StopLoss_IV < stoplevel_80 * Point / ld_88) li_324 = stoplevel_80 * Point / ld_88;
else li_324 = StopLoss_IV;
int li_328 = gi_480 + gi_876;
int li_332 = gi_480 + gi_876;
int li_336 = BegHourSys_III + gi_876;
int li_340 = EndHourSys_III + gi_876;
if (li_328 > 23) li_328 -= 24;
if (li_328 < 0) li_328 += 24;
if (li_336 > 23) li_336 -= 24;
if (li_336 < 0) li_336 += 24;
if (li_332 > 23) li_332 -= 24;
if (li_332 < 0) li_332 += 24;
if (li_340 > 23) li_340 -= 24;
if (li_340 < 0) li_340 += 24;
int li_344 = gi_580 + gi_876;
int li_348 = gi_584 + gi_876;
int li_352 = gi_588 + gi_876;
int li_356 = gi_592 + gi_876;
int li_360 = gi_596 + gi_876;
int li_364 = gi_600 + gi_876;
int li_368 = gi_604 + gi_876;
int li_372 = gi_608 + gi_876;
int li_376 = gi_612 + gi_876;
int li_380 = gi_616 + gi_876;
int li_384 = gi_620 + gi_876;
int li_388 = gi_624 + gi_876;
if (li_344 > 23) li_344 -= 24;
if (li_344 < 0) li_344 += 24;
if (li_348 > 23) li_348 -= 24;
if (li_348 < 0) li_348 += 24;
if (li_352 > 23) li_352 -= 24;
if (li_352 < 0) li_352 += 24;
if (li_356 > 23) li_356 -= 24;
if (li_356 < 0) li_356 += 24;
if (li_360 > 23) li_360 -= 24;
if (li_360 < 0) li_360 += 24;
if (li_364 > 23) li_364 -= 24;
if (li_364 < 0) li_364 += 24;
if (li_368 > 23) li_368 -= 24;
if (li_368 < 0) li_368 += 24;
if (li_372 > 23) li_372 -= 24;
if (li_372 < 0) li_372 += 24;
if (li_376 > 23) li_376 -= 24;
if (li_376 < 0) li_376 += 24;
if (li_380 > 23) li_380 -= 24;
if (li_380 < 0) li_380 += 24;
if (li_384 > 23) li_384 -= 24;
if (li_384 < 0) li_384 += 24;
if (li_388 > 23) li_388 -= 24;
if (li_388 < 0) li_388 += 24;
int slippage_392 = Slippage * (ld_88 / Point);
int count_396 = 0;
int count_400 = 0;
int count_404 = 0;
int count_408 = 0;
int count_412 = 0;
int count_416 = 0;
int count_420 = 0;
int count_424 = 0;
int datetime_428 = g_datetime_916;
int li_432 = g_datetime_916 + gi_544;
int datetime_436 = g_datetime_920;
int li_440 = g_datetime_920 + gi_652;
int datetime_444 = g_datetime_924;
int li_448 = g_datetime_924 + gi_744;
for (int pos_468 = OrdersTotal() - 1; pos_468 >= 0; pos_468--) {
if (!OrderSelect(pos_468, SELECT_BY_POS, MODE_TRADES)) Print("Error in OrderSelect! Position:", pos_468);
else {
if (OrderType() <= OP_SELL && OrderSymbol() == Symbol()) {
if (OrderMagicNumber() == Magic1) {
if (OrderType() == OP_BUY) {
if (OrderStopLoss() == 0.0 && Hidden_StopAndTarget == FALSE) {
price_472 = NormalizeDouble(OrderOpenPrice() - li_304 * ld_88, Digits);
price_480 = NormalizeDouble(OrderOpenPrice() + li_300 * ld_88, Digits);
OrderModify(OrderTicket(), OrderOpenPrice(), price_472, price_480, 0, Green);
}
if ((f0_22(gi_880, iwpr_188, OSC_close) == 0 && Bid > iclose_172 + gi_476 * ld_88) || Bid >= OrderOpenPrice() + li_300 * ld_88 || Bid <= OrderOpenPrice() - li_304 * ld_88) {
RefreshRates();
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits), slippage_392, Violet);
Sleep(5000);
} else count_396++;
} else {
if (OrderStopLoss() == 0.0 && Hidden_StopAndTarget == FALSE) {
price_472 = NormalizeDouble(OrderOpenPrice() + li_304 * ld_88, Digits);
price_480 = NormalizeDouble(OrderOpenPrice() - li_300 * ld_88, Digits);
OrderModify(OrderTicket(), OrderOpenPrice(), price_472, price_480, 0, Green);
}
if ((f0_22(gi_880, iwpr_188, OSC_close) == 1 && Bid < iclose_172 - gi_476 * ld_88) || Ask <= OrderOpenPrice() - li_300 * ld_88 || Ask >= OrderOpenPrice() + li_304 * ld_88) {
RefreshRates();
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits), slippage_392, Violet);
Sleep(5000);
} else count_400++;
}
}
if (OrderMagicNumber() == Magic2) {
if (OrderType() == OP_BUY) {
if (OrderStopLoss() == 0.0 && Hidden_StopAndTarget == FALSE) {
price_488 = NormalizeDouble(OrderOpenPrice() - li_312 * ld_88, Digits);
price_496 = NormalizeDouble(OrderOpenPrice() + li_308 * ld_88, Digits);
OrderModify(OrderTicket(), OrderOpenPrice(), price_488, price_496, 0, Green);
}
if ((f0_24(gi_880, iclose_228, ld_220, ld_212, Break * ld_88) == 0 && TimeCurrent() - OrderOpenTime() > 3600) || Bid >= OrderOpenPrice() + li_308 * ld_88 || Bid <= OrderOpenPrice() - li_312 * ld_88) {
RefreshRates();
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits), slippage_392, Violet);
Sleep(5000);
} else count_404++;
if (TimeCurrent() >= li_432) {
if (Use_Exp_Trailing_II) {
ld_504 = f0_9(Exp_Trail_Factor_II * ld_88, OrderOpenPrice(), iHigh(NULL, PERIOD_M5, iHighest(NULL, PERIOD_M5, MODE_HIGH, iBarShift(NULL, PERIOD_M5, OrderOpenTime()) +
1, 0)));
} else ld_504 = iatr_196 * ATRTrailingFactor2;
if (ld_504 > MaxPipsTrailing2 * ld_88) ld_504 = MaxPipsTrailing2 * ld_88;
if (ld_504 < MinPipsTrailing2 * ld_88) ld_504 = MinPipsTrailing2 * ld_88;
if (Bid - OrderOpenPrice() > F_TrailingProfit_II * ld_88 && (!Use_Exp_Trailing_II)) ld_504 = F_Trailing_II * ld_88;
price_512 = NormalizeDouble(Bid - ld_504, Digits);
if (Hidden_StopAndTarget) {
if (TimeCurrent() - OrderOpenTime() > 60 && Bid <= MathMax(OrderOpenPrice() - li_312 * ld_88, iHigh(NULL, PERIOD_M5, iHighest(NULL, PERIOD_M5, MODE_HIGH, iBarShift(NULL,
PERIOD_M5, OrderOpenTime()) + 1, 0)) - ld_504) && iHigh(NULL, PERIOD_M5, iHighest(NULL, PERIOD_M5, MODE_HIGH, iBarShift(NULL, PERIOD_M5, OrderOpenTime()) + 1, 0)) - OrderOpenPrice() > ld_504) {
RefreshRates();
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits), slippage_392, Violet);
Sleep(5000);
}
} else {
if (Bid - OrderOpenPrice() > ld_504) {
if (OrderStopLoss() <= price_512 - Point) {
bool_68 = OrderModify(OrderTicket(), OrderOpenPrice(), price_512, OrderTakeProfit(), 0, Blue);
if (bool_68) {
datetime_428 = TimeCurrent();
g_datetime_916 = datetime_428;
}
}
}
}
}
} else {
if (OrderStopLoss() == 0.0 && Hidden_StopAndTarget == FALSE) {
price_488 = NormalizeDouble(OrderOpenPrice() + li_312 * ld_88, Digits);
price_496 = NormalizeDouble(OrderOpenPrice() - li_308 * ld_88, Digits);
OrderModify(OrderTicket(), OrderOpenPrice(), price_488, price_496, 0, Green);
}
if ((f0_24(gi_880, iclose_228, ld_220, ld_212, Break * ld_88) == 1 && TimeCurrent() - OrderOpenTime() > 3600) || Ask <= OrderOpenPrice() - li_308 * ld_88 || Ask >= OrderOpenPrice() +
li_312 * ld_88) {
RefreshRates();
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits), slippage_392, Violet);
Sleep(5000);
} else count_408++;
if (TimeCurrent() >= li_432) {
if (Use_Exp_Trailing_II) {
ld_504 = f0_16(Exp_Trail_Factor_II * ld_88, OrderOpenPrice(), iLow(NULL, PERIOD_M5, iLowest(NULL, PERIOD_M5, MODE_LOW, iBarShift(NULL, PERIOD_M5, OrderOpenTime()) +
1, 0)) + Ask - Bid);
} else ld_504 = iatr_196 * ATRTrailingFactor2;
if (ld_504 > MaxPipsTrailing2 * ld_88) ld_504 = MaxPipsTrailing2 * ld_88;
if (ld_504 < MinPipsTrailing2 * ld_88) ld_504 = MinPipsTrailing2 * ld_88;
if (OrderOpenPrice() - Ask > F_TrailingProfit_II * ld_88 && (!Use_Exp_Trailing_II)) ld_504 = F_Trailing_II * ld_88;
price_512 = NormalizeDouble(Ask + ld_504, Digits);
if (Hidden_StopAndTarget) {
if (TimeCurrent() - OrderOpenTime() > 60 && Ask >= Ask - Bid + MathMin(OrderOpenPrice() + li_312 * ld_88, iLow(NULL, PERIOD_M5, iLowest(NULL, PERIOD_M5, MODE_LOW,
iBarShift(NULL, PERIOD_M5, OrderOpenTime()) + 1, 0)) + ld_504) && OrderOpenPrice() - (iLow(NULL, PERIOD_M5, iLowest(NULL, PERIOD_M5, MODE_LOW, iBarShift(NULL, PERIOD_M5,
OrderOpenTime()) + 1, 0)) + Ask - Bid) > ld_504) {
RefreshRates();
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits), slippage_392, Violet);
Sleep(5000);
}
} else {
if (OrderOpenPrice() - Ask > ld_504) {
if (OrderStopLoss() >= price_512 + Point) {
bool_68 = OrderModify(OrderTicket(), OrderOpenPrice(), price_512, OrderTakeProfit(), 0, Red);
if (bool_68) {
datetime_428 = TimeCurrent();
g_datetime_916 = datetime_428;
}
}
}
}
}
}
}
if (OrderMagicNumber() == Magic3) {
if (OrderType() == OP_BUY) {
if (OrderStopLoss() == 0.0 && Hidden_StopAndTarget == FALSE) {
price_520 = NormalizeDouble(OrderOpenPrice() - li_320 * ld_88, Digits);
price_528 = NormalizeDouble(OrderOpenPrice() + li_316 * ld_88, Digits);
OrderModify(OrderTicket(), OrderOpenPrice(), price_520, price_528, 0, Green);
}
if (((li_336 <= li_340 && TimeHour(TimeCurrent()) >= li_336 && TimeHour(TimeCurrent()) <= li_340) || (li_336 > li_340 && TimeHour(TimeCurrent()) >= li_336 || TimeHour(TimeCurrent()) <= li_340) &&
f0_20(gi_880, ibands_268, ibands_276, gi_684 * ld_88, ihigh_252, ilow_260, gi_680 * ld_88) == 0 && TimeCurrent() - OrderOpenTime() > 7200) || Bid >= OrderOpenPrice() +
li_316 * ld_88 || Bid <= OrderOpenPrice() - li_320 * ld_88) {
RefreshRates();
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits), slippage_392, Violet);
Sleep(5000);
} else count_412++;
if (TimeCurrent() >= li_440) {
if (Use_Exp_Trailing_III) {
ld_536 = Exp_Trail_Factor_III * ld_88 / MathMax(ld_88, iHigh(NULL, PERIOD_M5, iHighest(NULL, PERIOD_M5, MODE_HIGH, iBarShift(NULL, PERIOD_M5, OrderOpenTime()) + 1,
0)) - OrderOpenPrice());
} else ld_536 = iatr_244 * gd_668;
if (ld_536 > MaxPipsTrailing3 * ld_88) ld_536 = MaxPipsTrailing3 * ld_88;
if (ld_536 < MinPipsTrailing3 * ld_88) ld_536 = MinPipsTrailing3 * ld_88;
if (Bid - OrderOpenPrice() > F_TrailingProfit_III * ld_88 && (!Use_Exp_Trailing_III)) ld_536 = F_Trailing_III * ld_88;
price_544 = NormalizeDouble(Bid - ld_536, Digits);
if (Hidden_StopAndTarget) {
if (TimeCurrent() - OrderOpenTime() > 300 && Bid <= MathMax(OrderOpenPrice() - li_320 * ld_88, iHigh(NULL, PERIOD_M5, iHighest(NULL, PERIOD_M5, MODE_HIGH, iBarShift(NULL,
PERIOD_M5, OrderOpenTime()) + 1, 0)) - ld_536) && iHigh(NULL, PERIOD_M5, iHighest(NULL, PERIOD_M5, MODE_HIGH, iBarShift(NULL, PERIOD_M5, OrderOpenTime()) + 1, 0)) - OrderOpenPrice() > ld_536) {
RefreshRates();
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits), slippage_392, Violet);
Sleep(5000);
}
} else {
if (Bid - OrderOpenPrice() > ld_536) {
if (OrderStopLoss() <= price_544 - Point) {
bool_72 = OrderModify(OrderTicket(), OrderOpenPrice(), price_544, OrderTakeProfit(), 0, Blue);
if (bool_72) {
datetime_436 = TimeCurrent();
g_datetime_920 = datetime_436;
}
}
}
}
}
} else {
if (OrderStopLoss() == 0.0 && Hidden_StopAndTarget == FALSE) {
price_520 = NormalizeDouble(OrderOpenPrice() + li_320 * ld_88, Digits);
price_528 = NormalizeDouble(OrderOpenPrice() - li_316 * ld_88, Digits);
OrderModify(OrderTicket(), OrderOpenPrice(), price_520, price_528, 0, Green);
}
if (((li_336 <= li_340 && TimeHour(TimeCurrent()) >= li_336 && TimeHour(TimeCurrent()) <= li_340) || (li_336 > li_340 && TimeHour(TimeCurrent()) >= li_336 || TimeHour(TimeCurrent()) <= li_340) &&
f0_20(gi_880, ibands_268, ibands_276, gi_684 * ld_88, ihigh_252, ilow_260, gi_680 * ld_88) == 1 && TimeCurrent() - OrderOpenTime() > 7200) || Ask <= OrderOpenPrice() - li_316 * ld_88 ||
Ask >= OrderOpenPrice() + li_320 * ld_88) {
RefreshRates();
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits), slippage_392, Violet);
Sleep(5000);
} else count_416++;
if (TimeCurrent() >= li_440) {
if (Use_Exp_Trailing_III) {
ld_536 = Exp_Trail_Factor_III * ld_88 / MathMax(ld_88, OrderOpenPrice() - (iLow(NULL, PERIOD_M5, iLowest(NULL, PERIOD_M5, MODE_LOW, iBarShift(NULL, PERIOD_M5, OrderOpenTime()) +
1, 0)) + Ask - Bid));
} else ld_536 = iatr_244 * gd_668;
if (ld_536 > MaxPipsTrailing3 * ld_88) ld_536 = MaxPipsTrailing3 * ld_88;
if (ld_536 < MinPipsTrailing3 * ld_88) ld_536 = MinPipsTrailing3 * ld_88;
if (OrderOpenPrice() - Ask > F_TrailingProfit_III * ld_88 && (!Use_Exp_Trailing_III)) ld_536 = F_Trailing_III * ld_88;
price_544 = NormalizeDouble(Ask + ld_536, Digits);
if (Hidden_StopAndTarget) {
if (TimeCurrent() - OrderOpenTime() > 300 && Ask >= Ask - Bid + MathMin(OrderOpenPrice() + li_320 * ld_88, iLow(NULL, PERIOD_M5, iLowest(NULL, PERIOD_M5, MODE_LOW,
iBarShift(NULL, PERIOD_M5, OrderOpenTime()) + 1, 0)) + ld_536) && OrderOpenPrice() - (iLow(NULL, PERIOD_M5, iLowest(NULL, PERIOD_M5, MODE_LOW, iBarShift(NULL, PERIOD_M5,
OrderOpenTime()) + 1, 0)) + Ask - Bid) > ld_536) {
RefreshRates();
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits), slippage_392, Violet);
Sleep(5000);
}
} else {
if (OrderOpenPrice() - Ask > ld_536) {
if (OrderStopLoss() >= price_544 + Point) {
bool_72 = OrderModify(OrderTicket(), OrderOpenPrice(), price_544, OrderTakeProfit(), 0, Red);
if (bool_72) {
datetime_436 = TimeCurrent();
g_datetime_920 = datetime_436;
}
}
}
}
}
}
}
if (OrderMagicNumber() == Magic4) {
if (OrderType() == OP_BUY) {
if (OrderStopLoss() == 0.0 && Hidden_StopAndTarget == FALSE) {
price_552 = NormalizeDouble(ilow_292 - li_324 * ld_88, Digits);
price_560 = NormalizeDouble(OrderOpenPrice() + (ihigh_284 - ilow_292) * TargetPercent, Digits);
OrderModify(OrderTicket(), OrderOpenPrice(), price_552, price_560, 0, Green);
}
if ((TimeCurrent() - OrderOpenTime() > 300 && f0_15(gi_880, iClose(NULL, ReverseTF, 1), iOpen(NULL, ReverseTF, 1), Bid - OrderOpenPrice(), ExitProfit * ld_88) == 0) ||
Bid >= OrderOpenPrice() + (iHigh(NULL, PERIOD_H1, iHighest(NULL, PERIOD_H1, MODE_HIGH, gi_716, iBarShift(NULL, PERIOD_H1, OrderOpenTime()) + 1)) - iLow(NULL, PERIOD_H1,
iLowest(NULL, PERIOD_H1, MODE_LOW, gi_716, iBarShift(NULL, PERIOD_H1, OrderOpenTime()) + 1))) * TargetPercent || Bid <= iLow(NULL, PERIOD_H1, iLowest(NULL, PERIOD_H1,
MODE_LOW, gi_716, iBarShift(NULL, PERIOD_H1, OrderOpenTime()) + 1)) - li_324 * ld_88) {
RefreshRates();
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits), slippage_392, Violet);
Sleep(5000);
} else count_420++;
if (TimeCurrent() < li_448) continue;
if (Use_Exp_Trailing_IV) {
ld_536 = Exp_Trail_Factor_IV * ld_88 / MathMax(ld_88, iHigh(NULL, PERIOD_M5, iHighest(NULL, PERIOD_M5, MODE_HIGH, iBarShift(NULL, PERIOD_M5, OrderOpenTime()) + 1,
0)) - OrderOpenPrice());
} else ld_536 = iatr_244 * gd_756;
if (ld_536 > gi_748 * ld_88) ld_536 = gi_748 * ld_88;
if (ld_536 < gi_752 * ld_88) ld_536 = gi_752 * ld_88;
if (Bid - OrderOpenPrice() > gi_764 * ld_88 && (!Use_Exp_Trailing_IV)) ld_536 = gi_768 * ld_88;
price_544 = NormalizeDouble(Bid - ld_536, Digits);
if (Hidden_StopAndTarget) {
if (!(TimeCurrent() - OrderOpenTime() > 300 && Bid <= MathMax(OrderOpenPrice() - li_324 * ld_88, iHigh(NULL, PERIOD_M5, iHighest(NULL, PERIOD_M5, MODE_HIGH, iBarShift(NULL,
PERIOD_M5, OrderOpenTime()) + 1, 0)) - ld_536) && iHigh(NULL, PERIOD_M5, iHighest(NULL, PERIOD_M5, MODE_HIGH, iBarShift(NULL, PERIOD_M5, OrderOpenTime()) + 1, 0)) - OrderOpenPrice() > ld_536)) continue;
RefreshRates();
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Bid, Digits), slippage_392, Violet);
Sleep(5000);
} else {
if (Bid - OrderOpenPrice() <= ld_536) continue;
if (OrderStopLoss() > price_544 - Point) continue;
bool_76 = OrderModify(OrderTicket(), OrderOpenPrice(), price_544, OrderTakeProfit(), 0, Blue);
if (!(bool_76)) continue;
datetime_444 = TimeCurrent();
g_datetime_924 = datetime_444;
continue;
}
}
if (OrderStopLoss() == 0.0 && Hidden_StopAndTarget == FALSE) {
price_552 = NormalizeDouble(ihigh_284 + li_324 * ld_88, Digits);
price_560 = NormalizeDouble(OrderOpenPrice() - (ihigh_284 - ilow_292) * TargetPercent, Digits);
OrderModify(OrderTicket(), OrderOpenPrice(), price_552, price_560, 0, Green);
}
if ((TimeCurrent() - OrderOpenTime() > 300 && f0_15(gi_880, iClose(NULL, ReverseTF, 1), iOpen(NULL, ReverseTF, 1), OrderOpenPrice() - Ask, ExitProfit * ld_88) == 1) ||
Ask <= OrderOpenPrice() - (iHigh(NULL, PERIOD_H1, iHighest(NULL, PERIOD_H1, MODE_HIGH, gi_716, iBarShift(NULL, PERIOD_H1, OrderOpenTime()) + 1)) - iLow(NULL, PERIOD_H1,
iLowest(NULL, PERIOD_H1, MODE_LOW, gi_716, iBarShift(NULL, PERIOD_H1, OrderOpenTime()) + 1))) * TargetPercent || Ask >= iHigh(NULL, PERIOD_H1, iHighest(NULL, PERIOD_H1,
MODE_HIGH, gi_716, iBarShift(NULL, PERIOD_H1, OrderOpenTime()) + 1)) + li_324 * ld_88) {
RefreshRates();
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits), slippage_392, Violet);
Sleep(5000);
} else count_424++;
if (TimeCurrent() >= li_448) {
if (Use_Exp_Trailing_IV) {
ld_536 = Exp_Trail_Factor_IV * ld_88 / MathMax(ld_88, OrderOpenPrice() - (iLow(NULL, PERIOD_M5, iLowest(NULL, PERIOD_M5, MODE_LOW, iBarShift(NULL, PERIOD_M5, OrderOpenTime()) +
1, 0)) + Ask - Bid));
} else ld_536 = iatr_244 * gd_756;
if (ld_536 > gi_748 * ld_88) ld_536 = gi_748 * ld_88;
if (ld_536 < gi_752 * ld_88) ld_536 = gi_752 * ld_88;
if (OrderOpenPrice() - Ask > F_TrailingProfit_III * ld_88 && (!Use_Exp_Trailing_IV)) ld_536 = gi_768 * ld_88;
price_544 = NormalizeDouble(Ask + ld_536, Digits);
if (Hidden_StopAndTarget) {
if (!(TimeCurrent() - OrderOpenTime() > 300 && Ask >= Ask - Bid + MathMin(OrderOpenPrice() + li_324 * ld_88, iLow(NULL, PERIOD_M5, iLowest(NULL, PERIOD_M5, MODE_LOW,
iBarShift(NULL, PERIOD_M5, OrderOpenTime()) + 1, 0)) + ld_536) && OrderOpenPrice() - (iLow(NULL, PERIOD_M5, iLowest(NULL, PERIOD_M5, MODE_LOW, iBarShift(NULL, PERIOD_M5,
OrderOpenTime()) + 1, 0)) + Ask - Bid) > ld_536)) continue;
RefreshRates();
OrderClose(OrderTicket(), OrderLots(), NormalizeDouble(Ask, Digits), slippage_392, Violet);
Sleep(5000);
continue;
}
if (OrderOpenPrice() - Ask > ld_536) {
if (OrderStopLoss() >= price_544 + Point) {
bool_76 = OrderModify(OrderTicket(), OrderOpenPrice(), price_544, OrderTakeProfit(), 0, Red);
if (bool_76) {
datetime_444 = TimeCurrent();
g_datetime_924 = datetime_444;
}
}
}
}
}
}
}
}
double ld_568 = 0;
if (StringSubstr(AccountCurrency(), 0, 3) == "JPY") {
ld_568 = MarketInfo("USDJPY" + StringSubstr(Symbol(), 6), MODE_BID);
if (ld_568 > 0.1) ld_40 = ld_568;
else ld_40 = 84;
}
if (StringSubstr(AccountCurrency(), 0, 3) == "GBP") {
ld_568 = MarketInfo("GBPUSD" + StringSubstr(Symbol(), 6), MODE_BID);
if (ld_568 > 0.1) ld_40 = 1 / ld_568;
else ld_40 = 0.6211180124;
}
if (StringSubstr(AccountCurrency(), 0, 3) == "EUR") {
ld_568 = MarketInfo("EURUSD" + StringSubstr(Symbol(), 6), MODE_BID);
if (ld_568 > 0.1) ld_40 = 1 / ld_568;
else ld_40 = 0.7042253521;
}
if (EMAIL_Notification == TRUE) f0_7();
bool li_576 = TRUE;
bool li_580 = TRUE;
if (No_Hedge_Trades == TRUE && count_400 > 0 || count_408 > 0 || count_416 > 0 || count_424 > 0) li_576 = FALSE;
if (No_Hedge_Trades == TRUE && count_396 > 0 || count_404 > 0 || count_412 > 0 || count_420 > 0) li_580 = FALSE;
if (NFA_Compatibility == TRUE && count_400 > 0 || count_408 > 0 || count_416 > 0 || count_424 > 0 || count_396 > 0 || count_404 > 0 || count_412 > 0 || count_420 > 0) {
li_576 = FALSE;
li_580 = FALSE;
}
double lots_584 = MathMin(g_maxlot_892, MathMax(g_minlot_884, LotsSys1));
if (TradeMMSys1 > 0.0) lots_584 = MathMax(g_minlot_884, MathMin(g_maxlot_892, NormalizeDouble(f0_18() / ld_40 / 100.0 * AccountFreeMargin() / g_lotstep_908 / (g_lotsize_904 / 100), 0) * g_lotstep_908));
if (lots_584 > MaximalLots) lots_584 = MaximalLots;
double lots_592 = MathMin(g_maxlot_892, MathMax(g_minlot_884, LotsSys2));
if (TradeMMSys2 > 0.0) lots_592 = MathMax(g_minlot_884, MathMin(g_maxlot_892, NormalizeDouble(f0_0() / ld_40 / 100.0 * AccountFreeMargin() / g_lotstep_908 / (g_lotsize_904 / 100), 0) * g_lotstep_908));
if (lots_592 > MaximalLots) lots_592 = MaximalLots;
double lots_600 = MathMin(g_maxlot_892, MathMax(g_minlot_884, LotsSys3));
if (TradeMMSys3 > 0.0) lots_600 = MathMax(g_minlot_884, MathMin(g_maxlot_892, NormalizeDouble(f0_13() / ld_40 / 100.0 * AccountFreeMargin() / g_lotstep_908 / (g_lotsize_904 / 100), 0) * g_lotstep_908));
if (lots_600 > MaximalLots) lots_600 = MaximalLots;
double lots_608 = MathMin(g_maxlot_892, MathMax(g_minlot_884, LotsSys4));
if (TradeMMSys4 > 0.0) lots_608 = MathMax(g_minlot_884, MathMin(g_maxlot_892, NormalizeDouble(f0_21() / ld_40 / 100.0 * AccountFreeMargin() / g_lotstep_908 / (g_lotsize_904 / 100), 0) * g_lotstep_908));
if (lots_608 > MaximalLots) lots_608 = MaximalLots;
if (!Use_FXCOMBO_Scalping) lots_584 = 0;
if (!Use_FXCOMBO_Breakout) lots_592 = 0;
if (!Use_FXCOMBO_Reversal) lots_600 = 0;
if (!Use_FXCOMBO_EuroRange) lots_608 = 0;
gs_868 = "\n\n LOTS Sys1 : " + DoubleToStr(lots_584, 2)
+ "\n LOTS Sys2 : " + DoubleToStr(lots_592, 2)
+ "\n LOTS Sys3 : " + DoubleToStr(lots_600, 2)
+ "\n LOTS Sys4 : " + DoubleToStr(lots_608, 2);
int cmd_36 = -1;
if (Use_FXCOMBO_Scalping != FALSE) {
if (count_396 < 1 && li_576 && f0_3(gi_880, iclose_172, ima_180, TREND_STR * ld_88, iwpr_188, OSC_open, gi_488, Hour(), li_328, li_332) == 0 && Bid < iclose_172 - gi_476 * ld_88) {
if (ld_96 > MaxSPREAD) Print("System 1 BUY not taken due to high spead!");
else {
ls_616 = "BUY";
cmd_36 = 0;
color_32 = Aqua;
RefreshRates();
price_0 = NormalizeDouble(Ask, Digits);
price_8 = price_0 - li_304 * ld_88;
price_16 = price_0 + li_300 * ld_88;
}
}
if (count_400 < 1 && li_580 && f0_3(gi_880, iclose_172, ima_180, TREND_STR * ld_88, iwpr_188, OSC_open, gi_488, Hour(), li_328, li_332) == 1 && Bid > iclose_172 +
gi_476 * ld_88) {
if (ld_96 > MaxSPREAD) Print("System 1 SELL not taken due to high spead!");
else {
ls_616 = "SELL";
cmd_36 = 1;
color_32 = Red;
RefreshRates();
price_0 = NormalizeDouble(Bid, Digits);
price_8 = price_0 + li_304 * ld_88;
price_16 = price_0 - li_300 * ld_88;
}
}
}
if (cmd_36 >= OP_BUY && NewsFilterSys1 == FALSE || (NewsFilterSys1 && f0_12())) {
if (li_84 == FALSE) ticket_452 = OrderSend(Symbol(), cmd_36, lots_584, price_0, slippage_392, 0, 0, CommentSys1, Magic1, 0, color_32);
else ticket_452 = OrderSend(Symbol(), cmd_36, lots_584, price_0, slippage_392, price_8, price_16, CommentSys1, Magic1, 0, color_32);
Sleep(5000);
if (ticket_452 > 0) {
if (OrderSelect(ticket_452, SELECT_BY_TICKET, MODE_TRADES)) Print("Order " + ls_616 + " opened!: ", OrderOpenPrice());
} else Print("Error opening " + ls_616 + " order!: ", GetLastError());
} else {
if (cmd_36 >= OP_BUY && NewsFilterSys1 && g_datetime_928 != iTime(NULL, PERIOD_M5, 1)) {
g_datetime_928 = iTime(NULL, PERIOD_M5, 1);
if (cmd_36 == OP_BUY) Print("BUY skipped: " + gs_844);
else Print("SELL skipped: " + gs_844);
}
}
cmd_36 = -1;
if (!(TimeHour(TimeCurrent()) != li_344 && TimeHour(TimeCurrent()) != li_348 && TimeHour(TimeCurrent()) != li_352 && TimeHour(TimeCurrent()) != li_356 && TimeHour(TimeCurrent()) != li_360 &&
TimeHour(TimeCurrent()) != li_364 && TimeHour(TimeCurrent()) != li_368 && TimeHour(TimeCurrent()) != li_372 && TimeHour(TimeCurrent()) != li_376 && TimeHour(TimeCurrent()) != li_380 && TimeHour(TimeCurrent()) != li_384) ||
!(TimeHour(TimeCurrent()) != li_388)) {
if (Use_FXCOMBO_Breakout != FALSE) {
if (DayOfWeek() != gi_576) {
if (f0_4()) {
if (count_408 < 1 && li_580 && f0_6(gi_880, iclose_228, ld_220, ld_212, Break * ld_88, Bid, (Break - 3) * ld_88) == 1) {
if (ld_96 > MaxSPREAD) Print("System 2 SELL not taken due to high spead!");
else {
ls_616 = "SELL";
cmd_36 = 1;
color_32 = Yellow;
RefreshRates();
price_0 = NormalizeDouble(Bid, Digits);
price_8 = price_0 + li_312 * ld_88;
price_16 = price_0 - li_308 * ld_88;
}
}
if (count_404 < 1 && li_576 && f0_6(gi_880, iclose_228, ld_220, ld_212, Break * ld_88, Bid, (Break - 3) * ld_88) == 0) {
if (ld_96 > MaxSPREAD) Print("System 2 BUY not taken due to high spead!");
else {
ls_616 = "BUY";
cmd_36 = 0;
color_32 = DodgerBlue;
RefreshRates();
price_0 = NormalizeDouble(Ask, Digits);
price_8 = price_0 - li_312 * ld_88;
price_16 = price_0 + li_308 * ld_88;
}
}
}
}
}
}
if (cmd_36 >= OP_BUY && NewsFilterSys2 == FALSE || (NewsFilterSys2 && f0_12())) {
if (li_84 == FALSE) ticket_456 = OrderSend(Symbol(), cmd_36, lots_592, price_0, slippage_392, 0, 0, CommentSys2, Magic2, 0, color_32);
else ticket_456 = OrderSend(Symbol(), cmd_36, lots_592, price_0, slippage_392, price_8, price_16, CommentSys2, Magic2, 0, color_32);
Sleep(5000);
if (ticket_456 > 0) {
if (OrderSelect(ticket_456, SELECT_BY_TICKET, MODE_TRADES)) Print("Order " + ls_616 + " opened!: ", OrderOpenPrice());
} else Print("Error opening " + ls_616 + " order!: ", GetLastError());
} else {
if (cmd_36 >= OP_BUY && NewsFilterSys2 && g_datetime_928 != iTime(NULL, PERIOD_M5, 1)) {
g_datetime_928 = iTime(NULL, PERIOD_M5, 1);
if (cmd_36 == OP_BUY) Print("BUY skipped: " + gs_844);
else Print("SELL skipped: " + gs_844);
}
}
cmd_36 = -1;
if (Use_FXCOMBO_Reversal != FALSE) {
if (count_412 < 1 && li_576 && (li_336 <= li_340 && TimeHour(TimeCurrent()) >= li_336 && TimeHour(TimeCurrent()) <= li_340) || (li_336 > li_340 && TimeHour(TimeCurrent()) >= li_336 ||
TimeHour(TimeCurrent()) <= li_340) && f0_14(gi_880, ibands_268, ibands_276, gi_684 * ld_88, ihigh_252, ilow_260, gi_680 * ld_88) == 0) {
if (ld_96 > MaxSPREAD) Print("System 3 BUY not taken due to high spead!");
else {
ls_616 = "BUY";
cmd_36 = 0;
color_32 = Aqua;
RefreshRates();
price_0 = NormalizeDouble(Ask, Digits);
price_8 = price_0 - li_320 * ld_88;
price_16 = price_0 + li_316 * ld_88;
}
}
if (count_416 < 1 && li_580 && (li_336 <= li_340 && TimeHour(TimeCurrent()) >= li_336 && TimeHour(TimeCurrent()) <= li_340) || (li_336 > li_340 && TimeHour(TimeCurrent()) >= li_336 ||
TimeHour(TimeCurrent()) <= li_340) && f0_14(gi_880, ibands_268, ibands_276, gi_684 * ld_88, ihigh_252, ilow_260, gi_680 * ld_88) == 1) {
if (ld_96 > MaxSPREAD) Print("System 3 SELL not taken due to high spead!");
else {
ls_616 = "SELL";
cmd_36 = 1;
color_32 = DeepPink;
RefreshRates();
price_0 = NormalizeDouble(Bid, Digits);
price_8 = price_0 + li_320 * ld_88;
price_16 = price_0 - li_316 * ld_88;
}
}
}
if (cmd_36 >= OP_BUY && NewsFilterSys3 == FALSE || (NewsFilterSys3 && f0_12())) {
if (li_84 == FALSE) ticket_460 = OrderSend(Symbol(), cmd_36, lots_600, price_0, slippage_392, 0, 0, CommentSys3, Magic3, 0, color_32);
else ticket_460 = OrderSend(Symbol(), cmd_36, lots_600, price_0, slippage_392, price_8, price_16, CommentSys3, Magic3, 0, color_32);
Sleep(5000);
if (ticket_460 > 0) {
if (OrderSelect(ticket_460, SELECT_BY_TICKET, MODE_TRADES)) Print("Order " + ls_616 + " opened!: ", OrderOpenPrice());
} else Print("Error opening " + ls_616 + " order!: ", GetLastError());
} else {
if (cmd_36 >= OP_BUY && NewsFilterSys3 && g_datetime_928 != iTime(NULL, PERIOD_M5, 1)) {
g_datetime_928 = iTime(NULL, PERIOD_M5, 1);
if (cmd_36 == OP_BUY) Print("BUY skipped: " + gs_844);
else Print("SELL skipped: " + gs_844);
}
}
cmd_36 = -1;
if (Use_FXCOMBO_EuroRange != FALSE) {
if (count_420 < 1 && li_576 && f0_5(gi_880, gi_876, Hour(), Minute(), iOpen(NULL, PERIOD_M5, 0), ilow_292, ihigh_284, BreakPips * ld_88, gi_720 * ld_88, MaxRangePips * ld_88) == 0) {
if (ld_96 > MaxSPREAD) Print("System 4 BUY not taken due to high spead!");
else {
ls_616 = "BUY";
cmd_36 = 0;
color_32 = Aqua;
RefreshRates();
price_0 = NormalizeDouble(Ask, Digits);
price_8 = NormalizeDouble(ilow_292 - li_324 * ld_88, Digits);
price_16 = NormalizeDouble(Ask + (ihigh_284 - ilow_292) * TargetPercent, Digits);
}
}
if (count_424 < 1 && li_580 && f0_5(gi_880, gi_876, Hour(), Minute(), iOpen(NULL, PERIOD_M5, 0), ilow_292, ihigh_284, BreakPips * ld_88, gi_720 * ld_88, MaxRangePips * ld_88) == 1) {
if (ld_96 > MaxSPREAD) Print("System 3 SELL not taken due to high spead!");
else {
ls_616 = "SELL";
cmd_36 = 1;
color_32 = DeepPink;
RefreshRates();
price_0 = NormalizeDouble(Bid, Digits);
price_8 = NormalizeDouble(ihigh_284 + li_324 * ld_88, Digits);
price_16 = NormalizeDouble(Bid - (ihigh_284 - ilow_292) * TargetPercent, Digits);
}
}
}
if (cmd_36 >= OP_BUY && NewsFilterSys4 == FALSE || (NewsFilterSys4 && f0_12())) {
if (li_84 == FALSE) ticket_464 = OrderSend(Symbol(), cmd_36, lots_608, price_0, slippage_392, 0, 0, CommentSys4, Magic4, 0, color_32);
else ticket_464 = OrderSend(Symbol(), cmd_36, lots_608, price_0, slippage_392, price_8, price_16, CommentSys4, Magic4, 0, color_32);
Sleep(5000);
if (ticket_464 > 0) {
if (OrderSelect(ticket_464, SELECT_BY_TICKET, MODE_TRADES)) Print("Order " + ls_616 + " opened!: ", OrderOpenPrice());
} else Print("Error opening " + ls_616 + " order!: ", GetLastError());
} else {
if (cmd_36 >= OP_BUY && NewsFilterSys4 && g_datetime_928 != iTime(NULL, PERIOD_M5, 1)) {
g_datetime_928 = iTime(NULL, PERIOD_M5, 1);
if (cmd_36 == OP_BUY) Print("BUY skipped: " + gs_844);
else Print("SELL skipped: " + gs_844);
}
}
return (0);
}
// D02E3467D6EE65679474EA510952586A
double f0_18() {
int li_8;
double ld_16;
double ld_ret_0 = TradeMMSys1;
int li_12 = 0;
if (Digits <= 3) ld_16 = 0.01;
else ld_16 = 0.0001;
for (int hist_total_24 = OrdersHistoryTotal(); hist_total_24 >= 0; hist_total_24--) {
if (OrderSelect(hist_total_24, SELECT_BY_POS, MODE_HISTORY)) {
if (OrderType() <= OP_SELL && OrderSymbol() == Symbol() && OrderMagicNumber() == Magic1) {
if (OrderProfit() > 0.0) {
if (gi_280 == 0) break;
if (MathAbs(OrderClosePrice() - OrderOpenPrice()) / ld_16 > gi_280) break;
continue;
}
li_12++;
}
}
}
if (li_12 > gi_272 && gi_276 > 1) {
li_8 = MathMod(li_12, gi_276);
ld_ret_0 *= MathPow(LossFactorSys1, li_8);
}
if (MMMax > 0.0 && ld_ret_0 > MMMax) ld_ret_0 = MMMax;
return (ld_ret_0);
}