MT4 Files

Check-in [801981096e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Bind by array shows its limitation
Timelines: family | ancestors | descendants | both | exec_order
Files: files | file ages | folders
SHA1:801981096ea8ee99c9c383e8304c562c94c46b32
User & Date: onagano 2011-03-31 11:35:31
Context
2011-04-01
12:55
Added order execution EA check-in: 111cc509ae user: onagano tags: exec_order
2011-03-31
11:35
Bind by array shows its limitation check-in: 801981096e user: onagano tags: exec_order
11:24
Create new branch named "exec_order" check-in: 6f8f76001d user: onagano tags: exec_order
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to experts/MOB_insertData.mq4.

31
32
33
34
35
36
37
38

39
40
41
42
43
44
45
string   getPeriodSymbol(int period_XX);
int      createTableIfNotExists(string tableName, bool isBar = true);
string   insertSQL(string tableName, bool isBar = true);
datetime mob_time();
#import

//---- input parameters
extern string    ExtDataSourceName = "fxddx";

extern string    ExtUsername       = "";
extern string    ExtPassword       = "";
extern string    ExtTablePrefix    = "MOB_";

int      insertTick;
int      insertBar;
datetime lastTickTime;







|
>







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
string   getPeriodSymbol(int period_XX);
int      createTableIfNotExists(string tableName, bool isBar = true);
string   insertSQL(string tableName, bool isBar = true);
datetime mob_time();
#import

//---- input parameters
//extern string    ExtDataSourceName = "fxddx";
extern string    ExtDataSourceName = "testpostgresql";
extern string    ExtUsername       = "";
extern string    ExtPassword       = "";
extern string    ExtTablePrefix    = "MOB_";

int      insertTick;
int      insertBar;
datetime lastTickTime;

Changes to experts/libraries/MT4ODBCBridge.dll.

cannot compute difference between binary files

Changes to experts/libraries/mt4odbcbridge.mq4.

27
28
29
30
31
32
33




34
35
36
37
38
39
40
...
103
104
105
106
107
108
109
















110
111
112
113
114
115
116
int		MOB_getAutoCommit(int conId);
int		MOB_setAutoCommit(int conId, int autoCommit);
int      MOB_execute(int conId, string sql);
int      MOB_getLastErrorNo(int conId);
string   MOB_getLastErrorMesg(int conId);
int      MOB_registerStatement(int conId, string sql);
int      MOB_unregisterStatement(int conId, int stmtId);




int      MOB_insertTick(int conId, int stmtId, datetime dt, int fraction, double vals[], int size);
int      MOB_insertBar(int conId, int stmtId, datetime dt, double vals[], int size);
int      MOB_copyRates(int conId, int stmtId, double rates[][6], int size, int start, int end);
double   MOB_selectDouble(int conId, string sql, double defaultVal);
int      MOB_selectInt(int conId, string sql, int defaultVal);
datetime MOB_selectDatetime(int conId, string sql, datetime defaultVal);
datetime MOB_time();
................................................................................
int mob_registerStatement(string sql) {
   return (MOB_registerStatement(mob_conId, sql));
}

int mob_unregisterStatement(int stmtId) {
   return (MOB_unregisterStatement(mob_conId, stmtId));
}

















int mob_insertTick(int stmtId, datetime dt, int fraction, double vals[]) {
   return (MOB_insertTick(mob_conId, stmtId, dt, fraction, vals, ArraySize(vals)));
}

int mob_insertBar(int stmtId, datetime dt, double vals[]) {
   return (MOB_insertBar(mob_conId, stmtId, dt, vals, ArraySize(vals)));







>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
...
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
int		MOB_getAutoCommit(int conId);
int		MOB_setAutoCommit(int conId, int autoCommit);
int      MOB_execute(int conId, string sql);
int      MOB_getLastErrorNo(int conId);
string   MOB_getLastErrorMesg(int conId);
int      MOB_registerStatement(int conId, string sql);
int      MOB_unregisterStatement(int conId, int stmtId);
int      MOB_bindToFetch(int conId, int stmtId, datetime tVals[], int tSize, int iVals[], int iSize, double dVals[], int dSize, string sVals[], int sSize);
int      MOB_executeStatement(int conId, int stmtId, datetime tVals[], int tSize, int iVals[], int iSize, double dVals[], int dSize, string sVals[], int sSize);
int      MOB_fetch(int conId, int stmtId);
int      MOB_fetchedAll(int conId, int stmtId);
int      MOB_insertTick(int conId, int stmtId, datetime dt, int fraction, double vals[], int size);
int      MOB_insertBar(int conId, int stmtId, datetime dt, double vals[], int size);
int      MOB_copyRates(int conId, int stmtId, double rates[][6], int size, int start, int end);
double   MOB_selectDouble(int conId, string sql, double defaultVal);
int      MOB_selectInt(int conId, string sql, int defaultVal);
datetime MOB_selectDatetime(int conId, string sql, datetime defaultVal);
datetime MOB_time();
................................................................................
int mob_registerStatement(string sql) {
   return (MOB_registerStatement(mob_conId, sql));
}

int mob_unregisterStatement(int stmtId) {
   return (MOB_unregisterStatement(mob_conId, stmtId));
}

int mob_bindToFetch(int stmtId, datetime tVals[], int iVals[], double dVals[], string sVals[]) {
   return (MOB_bindToFetch(mob_conId, stmtId, tVals, ArraySize(tVals), iVals, ArraySize(iVals), dVals, ArraySize(dVals), sVals, ArraySize(sVals)));
}

int mob_executeStatement(int stmtId, datetime tVals[], int iVals[], double dVals[], string sVals[]) {
   return (MOB_executeStatement(mob_conId, stmtId, tVals, ArraySize(tVals), iVals, ArraySize(iVals), dVals, ArraySize(dVals), sVals, ArraySize(sVals)));
}

int mob_fetch(int stmtId) {
   return (MOB_fetch(mob_conId, stmtId));
}

int mob_fetchedAll(int stmtId) {
   return (MOB_fetchedAll(mob_conId, stmtId));
}

int mob_insertTick(int stmtId, datetime dt, int fraction, double vals[]) {
   return (MOB_insertTick(mob_conId, stmtId, dt, fraction, vals, ArraySize(vals)));
}

int mob_insertBar(int stmtId, datetime dt, double vals[]) {
   return (MOB_insertBar(mob_conId, stmtId, dt, vals, ArraySize(vals)));

Changes to experts/scripts/MOB_copyRates.mq4.

20
21
22
23
24
25
26
27
28
29
30
31
32
      Alert("ERROR: [Allow DLL imports] NOT Checked.");
      return (-1);
   }
//----
   int rc = 0;
   string tableName = getDefaultTableName();
   
   rc = copyRates("fxddx", NULL, NULL, tableName);
//----
   return(rc);
  }
//+------------------------------------------------------------------+








|





20
21
22
23
24
25
26
27
28
29
30
31
32
      Alert("ERROR: [Allow DLL imports] NOT Checked.");
      return (-1);
   }
//----
   int rc = 0;
   string tableName = getDefaultTableName();
   
   rc = copyRates("testpostgresql", NULL, NULL, tableName);
//----
   return(rc);
  }
//+------------------------------------------------------------------+

Changes to experts/scripts/testMT4ODBCBridge.mq4.

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
   int rc = 0;
   string tableName = getDefaultTableName();
   
//   rc = copyRates("testpostgresql", "testuser", "password", tableName);
   rc = copyRates("testpostgresql", NULL, NULL, tableName);
   
   
   int timeDiff = timeDifference("testpostgresql", "testuser", "password");
   Print("Time diff is ", timeDiff);
   
   mob_create();
   mob_open("testpostgresql", "testuser", "password");
   datetime dtMax = mob_selectDatetime("select max(time) from " + tableName, -1);
   datetime dtMin = mob_selectDatetime("select min(time) from " + tableName, -1);
   mob_close();

   Print("Max date selected ", TimeToStr(dtMax));
   Print("Min date selected ", TimeToStr(dtMin));
   







<



|



|







42
43
44
45
46
47
48

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
   int rc = 0;
   string tableName = getDefaultTableName();
   

   rc = copyRates("testpostgresql", NULL, NULL, tableName);
   
   
   int timeDiff = timeDifference("testpostgresql", NULL, NULL);
   Print("Time diff is ", timeDiff);
   
   mob_create();
   mob_open("testpostgresql", NULL, NULL);
   datetime dtMax = mob_selectDatetime("select max(time) from " + tableName, -1);
   datetime dtMin = mob_selectDatetime("select min(time) from " + tableName, -1);
   mob_close();

   Print("Max date selected ", TimeToStr(dtMax));
   Print("Min date selected ", TimeToStr(dtMin));