forked from vdemydiuk/mtapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMtApi.mq4
executable file
·8269 lines (7178 loc) · 439 KB
/
MtApi.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 "Vyacheslav Demidyuk"
#property link "http://mtapi4.net/"
#property version "1.13"
#property description "MtApi connection expert"
#include <WinUser32.mqh>
#include <stdlib.mqh>
#include <json.mqh>
#include <mql4-auth.mqh>
#import "MTConnector.dll"
bool initExpert(int expertHandle, int port, string symbol, double bid, double ask, string& err);
bool deinitExpert(int expertHandle, string& err);
bool updateQuote(int expertHandle, string symbol, double bid, double ask, string& err);
bool sendEvent(int expertHandle, int eventType, string payload, string& err);
bool sendIntResponse(int expertHandle, int response, string& err);
bool sendBooleanResponse(int expertHandle, int response, string& err);
bool sendDoubleResponse(int expertHandle, double response, string& err);
bool sendStringResponse(int expertHandle, string response, string& err);
bool sendVoidResponse(int expertHandle, string& err);
bool sendDoubleArrayResponse(int expertHandle, double& values[], int size, string& err);
bool sendIntArrayResponse(int expertHandle, int& values[], int size, string& err);
bool sendLongResponse(int expertHandle, long response, string& err);
bool sendErrorResponse(int expertHandle, int code, string message, string& err);
bool getCommandType(int expertHandle, int& res, string& err);
bool getIntValue(int expertHandle, int paramIndex, int& res, string& err);
bool getDoubleValue(int expertHandle, int paramIndex, double& res, string& err);
bool getStringValue(int expertHandle, int paramIndex, string& res, string& err);
bool getBooleanValue(int expertHandle, int paramIndex, int& res, string& err);
bool getLongValue(int expertHandle, int paramIndex, long& res, string& err);
bool containsNamedValue(int expertHandle, string paramName);
bool getNamedIntValue(int expertHandle, string paramName, int& res, string& err);
bool getNamedDoubleValue(int expertHandle, string paramName, double& res, string& err);
bool getNamedStringValue(int expertHandle, string paramName, string& res, string& err);
bool getNamedBooleanValue(int expertHandle, string paramName, bool& res, string& err);
bool getNamedLongValue(int expertHandle, string paramName, long& res, string& err);
#import
//wrapper function for boolean value
bool getBooleanValueW(int expertHandle, int paramIndex, bool& res, string& err)
{
int value;
bool retval = getBooleanValue(expertHandle, paramIndex, value, err);
res = value != 0;
return retval;
}
//#define __DEBUG_LOG__
extern int Port = 8222;
extern bool BacktestingLockTicks = false;
int ExpertHandle;
string _error;
string _response_error;
bool isCrashed = FALSE;
bool IsRemoteReadyForTesting = false;
int _lastBarOpenTime;
bool _is_ticks_locked = false;
class MtOrder
{
public:
int getTicket() { return _ticket; }
string getSymbol() { return _symbol; }
int getOperation() { return _operation; }
double getOpenPrice() { return _openPrice; }
double getClosePrice() { return _closePrice; }
double getLots() { return _lots; }
double getProfit() { return _profit; }
string getComment() { return _comment; }
double getCommission() { return _commission; }
int getMagicNumber() { return _magicNumber; }
datetime getOpenTime() { return _openTime; }
datetime getCloseTime() { return _closeTime; }
double getSwap() { return _swap; }
datetime getExpiration() { return _expiration; }
double getTakeProfit() { return _takeProfit; }
double getStopLoss() { return _stopLoss; }
static bool isLong(int operation)
{
if (operation == OP_BUY || operation == OP_BUYLIMIT || operation == OP_BUYSTOP)
return true;
return false;
}
JSONObject* CreateJson()
{
JSONObject *jo = new JSONObject();
jo.put("Ticket", new JSONNumber(_ticket));
jo.put("Symbol", new JSONString(_symbol));
jo.put("Operation", new JSONNumber(_operation));
jo.put("OpenPrice", new JSONNumber(_openPrice));
jo.put("ClosePrice", new JSONNumber(_closePrice));
jo.put("Lots", new JSONNumber(_lots));
jo.put("Profit", new JSONNumber(_profit));
if (_comment != "")
{
jo.put("Comment", new JSONString(_comment));
}
jo.put("Commission", new JSONNumber(_commission));
jo.put("MagicNumber", new JSONNumber(_magicNumber));
jo.put("MtOpenTime", new JSONNumber(_openTime));
jo.put("MtCloseTime", new JSONNumber(_closeTime));
jo.put("Swap", new JSONNumber(_swap));
jo.put("MtExpiration", new JSONNumber(_expiration));
jo.put("TakeProfit", new JSONNumber(_takeProfit));
jo.put("StopLoss", new JSONNumber(_stopLoss));
return jo;
}
static MtOrder* LoadOrder(int index, int select, int pool)
{
MtOrder* order = NULL;
if (OrderSelect(index, select, pool))
{
order = new MtOrder();
order._ticket = OrderTicket();
order._symbol = OrderSymbol();
order._operation = OrderType();
order._openPrice = OrderOpenPrice();
order._closePrice = OrderClosePrice();
order._lots = OrderLots();
order._profit = OrderProfit();
order._commission = OrderCommission();
order._magicNumber = OrderMagicNumber();
order._openTime = OrderOpenTime();
order._closeTime = OrderCloseTime();
order._swap = OrderSwap();
order._expiration = OrderExpiration();
order._takeProfit = OrderTakeProfit();
order._stopLoss = OrderStopLoss();
if (!IsTesting())
{
order._comment = OrderComment();
}
}
return order;
}
private:
int _ticket;
string _symbol;
int _operation;
double _openPrice;
double _closePrice;
double _lots;
double _profit;
string _comment;
double _commission;
int _magicNumber;
datetime _openTime;
datetime _closeTime;
double _swap;
datetime _expiration;
double _takeProfit;
double _stopLoss;
};
class MtEvent
{
public:
virtual JSONObject* CreateJson() = 0;
};
class MtTimeBar: public MtEvent
{
public:
MtTimeBar(string symbol, datetime openTime, datetime closeTime, double open, double close, double high, double low)
{
_symbol = symbol;
_openTime = openTime;
_closeTime = closeTime;
_open = open;
_close = close;
_high = high;
_low = low;
}
virtual JSONObject* CreateJson()
{
JSONObject *jo = new JSONObject();
jo.put("Symbol", new JSONString(_symbol));
jo.put("MtOpenTime", new JSONNumber(_openTime));
jo.put("MtCloseTime", new JSONNumber(_closeTime));
jo.put("Open", new JSONNumber(_open));
jo.put("Close", new JSONNumber(_close));
jo.put("High", new JSONNumber(_high));
jo.put("Low", new JSONNumber(_low));
return jo;
}
private:
string _symbol;
datetime _openTime;
datetime _closeTime;
double _open;
double _close;
double _high;
double _low;
};
class MtChartEvent: public MtEvent
{
public:
MtChartEvent(long chartId, int eventId, long lparam, double dparam, string sparam)
{
_chartId = chartId;
_eventId = eventId;
_lparam = lparam;
_dparam = dparam;
_sparam = sparam;
}
virtual JSONObject* CreateJson()
{
JSONObject *jo = new JSONObject();
jo.put("ChartId", new JSONNumber(_chartId));
jo.put("EventId", new JSONNumber(_eventId));
jo.put("Lparam", new JSONNumber(_lparam));
jo.put("Dparam", new JSONNumber(_dparam));
jo.put("Sparam", new JSONString(_sparam));
return jo;
}
private:
long _chartId;
int _eventId;
long _lparam;
double _dparam;
string _sparam;
};
class MtSession
{
public:
static MtSession* LoadSession(string symbol, int day, int index, int type)
{
MtSession *session = new MtSession(symbol, day, index, type);
if (type == QUOTE)
{
session._hasData = SymbolInfoSessionQuote(symbol, day, index, session._from, session._to);
}
else
{
session._hasData = SymbolInfoSessionTrade(symbol, day, index, session._from, session._to);
}
return session;
}
JSONObject* CreateJson()
{
JSONObject *jo = new JSONObject();
jo.put("Symbol", new JSONString(_symbol));
jo.put("DayOfWeek", new JSONNumber(_dayOfWeek));
jo.put("Index", new JSONNumber(_index));
jo.put("MtFromTime", new JSONNumber(_from));
jo.put("MtToTime", new JSONNumber(_to));
jo.put("HasData", new JSONBool(_hasData));
jo.put("Type", new JSONNumber(_type));
return jo;
}
private:
string _symbol;
int _dayOfWeek;
int _index;
datetime _from;
datetime _to;
bool _hasData;
int _type;
MtSession(string symbol, int day, int index, int type)
{
_symbol = symbol;
_dayOfWeek = day;
_index = index;
_type = type;
}
};
enum MtSessionType
{
QUOTE,
TRADE
};
enum MtEventTypes
{
LAST_TIME_BAR_EVENT = 1,
MT_CHART_EVENT = 2
};
int preinit()
{
StringInit(_error,1000,0);
StringInit(_response_error,1000,0);
return (0);
}
int init() {
preinit();
if (IsDllsAllowed() == FALSE)
{
MessageBox("Dlls not allowed.", "MtApi", MB_OK);
isCrashed = TRUE;
return (1);
}
if (IsLibrariesAllowed() == FALSE)
{
MessageBox("Libraries not allowed.", "MtApi", MB_OK);
isCrashed = TRUE;
return (1);
}
if (IsTradeAllowed() == FALSE)
{
MessageBox("Trade not allowed.", "MtApi", MB_OK);
isCrashed = TRUE;
return (1);
}
ExpertHandle = WindowHandle(Symbol(), Period());
if (!initExpert(ExpertHandle, Port, Symbol(), Bid, Ask, _error))
{
MessageBox(_error, "MtApi", MB_OK);
isCrashed = TRUE;
return(1);
}
if (ExecuteCommand() == 1)
{
isCrashed = TRUE;
return (1);
}
//--- Backtesting mode
if (IsTesting())
{
Print("Waiting on remote client...");
//wait for command (BacktestingReady) from remote side to be ready for work
while(!IsRemoteReadyForTesting)
{
ExecuteCommand();
//This section uses a while loop to simulate Sleep() during Backtest.
unsigned int viSleepUntilTick = GetTickCount() + 100; //100 milliseconds
while(GetTickCount() < viSleepUntilTick)
{
//Do absolutely nothing. Just loop until the desired tick is reached.
}
}
}
//---
_lastBarOpenTime = Time[0];
return (0);
}
int deinit() {
if (isCrashed == 0)
{
if (!deinitExpert(ExpertHandle, _error))
{
MessageBox(_error, "MtApi", MB_OK);
isCrashed = TRUE;
return (1);
}
}
return (0);
}
int _tick_count = 0;
int start()
{
if (_lastBarOpenTime != Time[0])
{
double open = Open[1];
double close = Close[1];
double high = High[1];
double low = Low[1];
MtTimeBar* timeBar = new MtTimeBar(Symbol(), _lastBarOpenTime, Time[0], open, close, high, low);
SendMtEvent(LAST_TIME_BAR_EVENT, timeBar);
delete timeBar;
_lastBarOpenTime = Time[0];
_is_ticks_locked = true;
}
updateQuote(ExpertHandle, Symbol(), Bid, Ask, _error);
if (IsTesting())
{
while(true)
{
int executedCommand = ExecuteCommand();
if (BacktestingLockTicks && _is_ticks_locked)
continue;
if (executedCommand == 0)
break;
}
}
return (0);
}
void OnTimer()
{
while(true)
{
int executedCommand = ExecuteCommand();
if (executedCommand == 0) return;
}
}
void OnChartEvent(const int id, // Event ID
const long& lparam, // Parameter of type long event
const double& dparam, // Parameter of type double event
const string& sparam // Parameter of type string events
)
{
MtChartEvent* charEvent = new MtChartEvent(ChartID(), id, lparam, dparam, sparam);
SendMtEvent(MT_CHART_EVENT, charEvent);
delete charEvent;
}
void SendMtEvent(MtEventTypes eventType, MtEvent* mtEvent)
{
JSONObject* json = mtEvent.CreateJson();
if (sendEvent(ExpertHandle, (int)eventType, json.toString(), _error))
{
#ifdef __DEBUG_LOG__
Print("Send SendMtEvent event: payload = ", json.toString());
#endif
}
else
{
PrintFormat("[ERROR] SendMtEvent: %s", _error);
}
delete json;
}
int ExecuteCommand()
{
int command_type = 0;
if (!getCommandType(ExpertHandle, command_type, _error))
{
Print("[ERROR] ExecuteCommand: Failed to get command type!", _error);
return (0);
}
if (command_type > 0)
{
#ifdef __DEBUG_LOG__
Print("ExecuteCommand: commnad type = ", command_type);
#endif
}
switch (command_type)
{
case 0:
//NoCommand
break;
case 155: //Request
Execute_Request();
break;
case 151: //OrderCloseAll
Execute_OrderCloseAll();
break;
case 3: // OrderCloseBy
Execute_OrderCloseBy();
break;
case 4: // OrderClosePrice
Execute_OrderClosePrice();
break;
case 1004: // OrderClosePriceByTicket
Execute_OrderClosePriceByTicket();
break;
case 5: //OrderCloseTime
Execute_OrderCloseTime();
break;
case 6: //OrderComment
Execute_OrderComment();
break;
case 7: //OrderCommission
Execute_OrderCommission();
break;
case 8: //OrderDelete
Execute_OrderDelete();
break;
case 9: //OrderExpiration
Execute_OrderExpiration();
break;
case 10: //OrderLots
Execute_OrderLots();
break;
case 11: //OrderMagicNumber
Execute_OrderMagicNumber();
break;
case 12: //OrderModify
Execute_OrderModify();
break;
case 13: //OrderOpenPrice
Execute_OrderOpenPrice();
break;
case 1013: // OrderOpenPriceByTicket
Execute_OrderOpenPriceByTicket();
break;
case 14: //OrderOpenTime
Execute_OrderOpenTime();
break;
case 15: //OrderPrint
Execute_OrderPrint();
break;
case 16: //OrderProfit
Execute_OrderProfit();
break;
case 17: //OrderSelect
Execute_OrderSelect();
break;
case 18: //OrdersHistoryTotal
Execute_OrdersHistoryTotal();
break;
case 19: //OrderStopLoss
Execute_OrderStopLoss();
break;
case 20: //OrdersTotal
Execute_OrdersTotal();
break;
case 21: //OrderSwap
Execute_OrderSwap();
break;
case 22: //OrderSymbol
Execute_OrderSymbol();
break;
case 23: //OrderTakeProfit
Execute_OrderTakeProfit();
break;
case 24: //OrderTicket
Execute_OrderTicket();
break;
case 25: //OrderType
Execute_OrderType();
break;
case 26: //GetLastError
Execute_GetLastError();
break;
case 27: //IsConnected
Execute_IsConnected();
break;
case 28: //IsDemo
Execute_IsDemo();
break;
case 29: //IsDllsAllowed
Execute_IsDllsAllowed();
break;
case 30: //IsExpertEnabled
Execute_IsExpertEnabled();
break;
case 31: //IsLibrariesAllowed
Execute_IsLibrariesAllowed();
break;
case 32: //IsOptimization
Execute_IsOptimization();
break;
case 33: //IsStopped
Execute_IsStopped();
break;
case 34: //IsTesting
Execute_IsTesting();
break;
case 35: //IsTradeAllowed
Execute_IsTradeAllowed();
break;
case 36: //IsTradeContextBusy
Execute_IsTradeContextBusy();
break;
case 37: //IsVisualMode
Execute_IsVisualMode();
break;
case 38: //UninitializeReason
Execute_UninitializeReason();
break;
case 39: //ErrorDescription
Execute_ErrorDescription();
break;
case 40: //AccountBalance
Execute_AccountBalance();
break;
case 41: //AccountCredit
Execute_AccountCredit();
break;
case 42: //AccountCompany
Execute_AccountCompany();
break;
case 43: //AccountCurrency
Execute_AccountCurrency();
break;
case 44: //AccountEquity
Execute_AccountEquity();
break;
case 45: //AccountFreeMargin
Execute_AccountFreeMargin();
break;
case 46: //AccountFreeMarginCheck
Execute_AccountFreeMarginCheck();
break;
case 47: //AccountFreeMarginMode
Execute_AccountFreeMarginMode();
break;
case 48: //AccountLeverage
Execute_AccountLeverage();
break;
case 49: //AccountMargin
Execute_AccountMargin();
break;
case 50: //AccountName
Execute_AccountName();
break;
case 51: //AccountNumber
Execute_AccountNumber();
break;
case 52: //AccountProfit
Execute_AccountProfit();
break;
case 53: //AccountServer
Execute_AccountServer();
break;
case 54: //AccountStopoutLevel
Execute_AccountStopoutLevel();
break;
case 55: //AccountStopoutMode
Execute_AccountStopoutMode();
break;
case 56: //Alert
Execute_Alert();
break;
case 57: //Comment
Execute_Comment();
break;
case 58: //GetTickCount
Execute_GetTickCount();
break;
case 59: //MarketInfo
Execute_MarketInfo();
break;
case 60: //MessageBox
Execute_MessageBox(false);
break;
case 61: //MessageBoxA
Execute_MessageBox(true);
break;
case 62: //PlaySound
Execute_PlaySound();
break;
case 63: //Print
Execute_Print();
break;
case 64: //SendFTP
Execute_SendFTP(false);
break;
case 65: //SendFTPA
Execute_SendFTP(true);
break;
case 66: //SendMail
Execute_SendMail();
break;
case 67: //Sleep
Execute_Sleep();
break;
case 68: //TerminalCompany
Execute_TerminalCompany();
break;
case 69: //TerminalName
Execute_TerminalName();
break;
case 70: //TerminalPath
Execute_TerminalPath();
break;
case 71: //Day
Execute_Day();
break;
case 72: //DayOfWeek
Execute_DayOfWeek();
break;
case 73: //DayOfYear
Execute_DayOfYear();
break;
case 74: //Hour
Execute_Hour();
break;
case 75: //Minute
Execute_Minute();
break;
case 76: //Month
Execute_Month();
break;
case 77: //Seconds
Execute_Seconds();
break;
case 78: //TimeCurrent
Execute_TimeCurrent();
break;
case 79: //TimeDay
Execute_TimeDay();
break;
case 80: //TimeDayOfWeek
Execute_TimeDayOfWeek();
break;
case 81: //TimeDayOfYear
Execute_TimeDayOfYear();
break;
case 82: //TimeHour
Execute_TimeHour();
break;
case 83: //TimeLocal
Execute_TimeLocal();
break;
case 84: //TimeMinute
Execute_TimeMinute();
break;
case 85: //TimeMonth
Execute_TimeMonth();
break;
case 86: //TimeSeconds
Execute_TimeSeconds();
break;
case 87: //TimeYear
Execute_TimeYear();
break;
case 88: //Year
Execute_Year();
break;
case 89: //GlobalVariableCheck
Execute_GlobalVariableCheck();
break;
case 90: //GlobalVariableDel
Execute_GlobalVariableDel();
break;
case 91: //GlobalVariableGet
Execute_GlobalVariableGet();
break;
case 92: //GlobalVariableName
Execute_GlobalVariableName();
break;
case 93: //GlobalVariableSet
Execute_GlobalVariableSet();
break;
case 94: //GlobalVariableSetOnCondition
Execute_GlobalVariableSetOnCondition();
break;
case 95: //GlobalVariablesDeleteAll
Execute_GlobalVariablesDeleteAll();
break;
case 96: //GlobalVariablesTotal
Execute_GlobalVariablesTotal();
break;
case 97: //iAC
Execute_iAC();
break;
case 98: //iAD
Execute_iAD();
break;
case 99: //iAlligator
Execute_iAlligator();
break;
case 100: //iADX
Execute_iADX();
break;
case 101: //iATR
Execute_iATR();
break;
case 102: //iAO
Execute_iAO();
break;
case 103: //iBearsPower
Execute_iBearsPower();
break;
case 104: //iBands
Execute_iBands();
break;
case 105: //iBandsOnArray
Execute_iBandsOnArray();
break;
case 106: //iBullsPower
Execute_iBullsPower();
break;
case 107: //iCCI
Execute_iCCI();
break;
case 108: //iCCIOnArray
Execute_iCCIOnArray();
break;
case 109: //iCustom
//redesigned to request
break;
case 110: //iDeMarker
Execute_iDeMarker();
break;
case 111: //iEnvelopes
Execute_iEnvelopes();
break;
case 112: //iEnvelopesOnArray
Execute_iEnvelopesOnArray();
break;
case 113: //iForce
Execute_iForce();
break;
case 114: //iFractals
Execute_iFractals();
break;
case 115: //iGator
Execute_iGator();
break;
case 116: //iIchimoku
Execute_iIchimoku();
break;
case 117: //iBWMFI
Execute_iBWMFI();
break;
case 118: //iMomentum
Execute_iMomentum();
break;
case 119: //iMomentumOnArray
Execute_iMomentumOnArray();
break;
case 120: //iMFI
Execute_iMFI();
break;
case 121: //iMA
Execute_iMA();
break;
case 122: //iMAOnArray
Execute_iMAOnArray();
break;
case 123: //iOsMA
Execute_iOsMA();
break;
case 124: //iMACD
Execute_iMACD();
break;
case 125: //iOBV
Execute_iOBV();
break;
case 126: //iSAR
Execute_iSAR();
break;
case 127: //iRSI
Execute_iRSI();
break;
case 128: //iRSIOnArray
Execute_iRSIOnArray();
break;
case 129: //iRVI
Execute_iRVI();
break;
case 130: //iStdDev
Execute_iStdDev();
break;
case 131: //iStdDevOnArray
Execute_iStdDevOnArray();
break;
case 132: //iStochastic
Execute_iStochastic();
break;
case 133: //iWPR
Execute_iWPR();
break;
case 134: //iBars
Execute_iBars();
break;
case 135: //iBarShift
Execute_iBarShift();
break;
case 136: //iClose
Execute_iClose();
break;
case 137: //iHigh
Execute_iHigh();
break;
case 138: //iHighest
Execute_iHighest();
break;
case 139: //iLow
Execute_iLow();
break;
case 140: //iLowest
Execute_iLowest();
break;
case 141: //iOpen
Execute_iOpen();
break;
case 142: //iTime
Execute_iTime();
break;
case 143: //iVolume
Execute_iVolume();
break;
case 144: //iCloseArray
Execute_iCloseArray();
break;
case 145: //iHighArray
Execute_iHighArray();
break;
case 146: //iLowArray
Execute_iLowArray();
break;
case 147: //iOpenArray
Execute_iOpenArray();
break;
case 148: //iVolumeArray
Execute_iVolumeArray();
break;
case 149: //iTimeArray
Execute_iTimeArray();
break;
case 150: //RefreshRates
Execute_RefreshRates();
break;
case 153: //TerminalInfoString
Execute_TerminalInfoString();
break;
case 154: //SymbolInfoString
Execute_SymbolInfoString();
break;
case 156: //BacktestingReady
Execute_BacktestingReady();
break;
case 200: //SymbolsTotal
Execute_SymbolsTotal();
break;
case 201: //SymbolName
Execute_SymbolName();
break;
case 202: //SymbolSelect
Execute_SymbolSelect();
break;
case 203: //SymbolInfoInteger
Execute_SymbolInfoInteger();
break;
case 204: //TerminalInfoInteger
Execute_TerminalInfoInteger();
break;
case 205: //TerminalInfoDouble
Execute_TerminalInfoDouble();
break;
case 206: //ChartId
Execute_CharId();
break;
case 207: //ChartRedraw
Execute_ChartRedraw();
break;
case 208: //ObjectCreate
Execute_ObjectCreate();
break;
case 209: //ObjectName
Execute_ObjectName();
break;
case 210: //ObjectDelete
Execute_ObjectDelete();
break;
case 211: //ObjectsDeleteAll
Execute_ObjectsDeleteAll();
break;
case 212: //ObjectFind
Execute_ObjectFind();
break;
case 213: //ObjectGetTimeByValue
Execute_ObjectGetTimeByValue();
break;
case 214: //ObjectGetValueByTime
Execute_ObjectGetValueByTime();
break;
case 215: //ObjectMove
Execute_ObjectMove();
break;
case 216: //ObjectsTotal
Execute_ObjectsTotal();
break;
case 217: //ObjectGetDouble
Execute_ObjectGetDouble();
break;