Skip to content

Commit dde02b4

Browse files
committed
Merge PR #45: Updates and bugfixes from 'development'
2 parents ed353ab + 00ab782 commit dde02b4

36 files changed

+689
-578
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ updates:
44
- package-ecosystem: github-actions
55
directory: /
66
schedule:
7-
interval: monthly
7+
interval: quarterly
88
open-pull-requests-limit: 1

bin/mqlc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ function readConfig() {
717717
local -A includeDirs; includeDirs=()
718718

719719
# source the config file # TODO: parse the file
720-
[[ -n "$config" ]] && . "$config"
720+
[[ -n "$config" ]] && . "$config" &> /dev/null
721721

722722
# resolve compiler settings: environment precedes configuration
723723
[[ "${MT4_METALANG:-}" == '<'* ]] && MT4_METALANG= # skip distributed/example values

mql40/include/rsf/MT4Expander.mqh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,20 @@
157157
string UninitReasonToStr(int reason);
158158

159159
// window property management
160-
bool SetWindowIntegerA (int hWnd, string name, int value);
160+
int GetWindowPropertyA (int hWnd, string name);
161+
bool SetWindowPropertyA (int hWnd, string name, int value);
162+
int RemoveWindowPropertyA(int hWnd, string name);
163+
161164
int GetWindowIntegerA (int hWnd, string name);
165+
bool SetWindowIntegerA (int hWnd, string name, int value);
162166
int RemoveWindowIntegerA(int hWnd, string name);
163167

164-
bool SetWindowDoubleA (int hWnd, string name, double value);
165168
double GetWindowDoubleA (int hWnd, string name);
169+
bool SetWindowDoubleA (int hWnd, string name, double value);
166170
double RemoveWindowDoubleA(int hWnd, string name);
167171

168-
bool SetWindowStringA (int hWnd, string name, string value);
169172
string GetWindowStringA (int hWnd, string name);
173+
bool SetWindowStringA (int hWnd, string name, string value);
170174
string RemoveWindowStringA(int hWnd, string name);
171175

172176
// other

mql40/include/rsf/api.mqh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ bool StrIsPhoneNumber(string value);;
179179
string StrLeftTo(string value, string substring, int count=1);;
180180
string StrPadLeft(string str, int pad_length, string pad_string=" ");;
181181
string StrRepeat(string str, int times);;
182-
string StrReplace(string str, string search, string replace, bool recursive=false);;
182+
string StrReplace(string subject, string search, string replace, bool recursive=false);;
183183
string StrRight(string value, int n);;
184184
string StrRightFrom(string value, string substring, int count=1);;
185185
bool StrStartsWithI(string value, string prefix);;
@@ -225,9 +225,8 @@ bool ComputeFloatingProfits(string &symbols[], double &profits[], bool inclu
225225
bool ConfigureSignals(string signalId, bool autoConfig, bool &enabled);;
226226
bool ConfigureSignalsByMail(string signalId, bool autoConfig, bool &enabled);;
227227
bool ConfigureSignalsByAlert(string signalId, bool autoConfig, bool &enabled);;
228-
bool ConfigureSignalsBySMS(string signalId, bool autoConfig, bool &enabled);;
229228
bool ConfigureSignalsBySound(string signalId, bool autoConfig, bool &enabled);;
230-
bool ConfigureSignalTypes(string signalId, string signalTypes, bool autoConfig, bool &soundEnabled, bool &alertEnabled, bool &mailEnabled, bool &smsEnabled);;
229+
bool ConfigureSignalTypes(string signalId, string signalTypes, bool autoConfig, bool &soundEnabled, bool &alertEnabled, bool &mailEnabled);;
231230
int DeleteRegisteredObjects();;
232231
int ExplodeStrings(int &buffer[], string &results[]);;
233232
bool GetChartCommand(string channel, string &commands[]);;

mql40/include/rsf/functions/ConfigureSignals.mqh

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ bool ConfigureSignals(string signalId, bool autoConfig, bool &enabled) {
2222
ConfigureSignalsBySound(NULL, NULL, bNull);
2323
ConfigureSignalsByAlert(NULL, NULL, bNull);
2424
ConfigureSignalsByMail(NULL, NULL, bNull);
25-
ConfigureSignalsBySMS(NULL, NULL, bNull);
26-
ConfigureSignalTypes(NULL, NULL, NULL, bNull, bNull, bNull, bNull);
25+
ConfigureSignalTypes(NULL, NULL, NULL, bNull, bNull, bNull);
2726
}
2827

2928

@@ -90,27 +89,6 @@ bool ConfigureSignalsByMail(string signalId, bool autoConfig, bool &enabled) {
9089
}
9190

9291

93-
/**
94-
* Configure signaling by text message.
95-
*
96-
* @param _In_ string signalId - case-insensitive signal identifier
97-
* @param _In_ bool autoConfig - input parameter AutoConfiguration
98-
* @param _InOut_ bool enabled - input parameter (in) and final activation status (out)
99-
*
100-
* @return bool - validation success status
101-
*/
102-
bool ConfigureSignalsBySMS(string signalId, bool autoConfig, bool &enabled) {
103-
autoConfig = autoConfig!=0;
104-
enabled = enabled!=0;
105-
106-
if (autoConfig) {
107-
string section = ifString(__isTesting, "Tester.", "") + ProgramName();
108-
enabled = GetConfigBool(section, signalId +".SMS", enabled);
109-
}
110-
return(true);
111-
}
112-
113-
11492
/**
11593
* Validate and configure the passed signal types.
11694
*
@@ -120,18 +98,16 @@ bool ConfigureSignalsBySMS(string signalId, bool autoConfig, bool &enabled) {
12098
* @param _InOut_ bool soundEnabled - current (in) and final activation status (out) for signaling by sound
12199
* @param _InOut_ bool alertEnabled - current (in) and final activation status (out) for signaling by alert
122100
* @param _InOut_ bool mailEnabled - current (in) and final activation status (out) for signaling by mail
123-
* @param _InOut_ bool smsEnabled - current (in) and final activation status (out) for signaling by text message
124101
*
125102
* @return bool - validation success status
126103
*/
127-
bool ConfigureSignalTypes(string signalId, string signalTypes, bool autoConfig, bool &soundEnabled, bool &alertEnabled, bool &mailEnabled, bool &smsEnabled) {
104+
bool ConfigureSignalTypes(string signalId, string signalTypes, bool autoConfig, bool &soundEnabled, bool &alertEnabled, bool &mailEnabled) {
128105
autoConfig = autoConfig!=0; // supported syntax variants:
129-
soundEnabled = soundEnabled!=0; // "sound* | alert | mail | sms"
130-
alertEnabled = alertEnabled!=0; // "sound* | alert* | mail | sms"
131-
mailEnabled = mailEnabled!=0; // "sound | alert | mail | sms"
132-
smsEnabled = smsEnabled!=0; // "sound, alert, mail, sms"
133-
// "sound alert mail sms"
134-
if (autoConfig) {
106+
soundEnabled = soundEnabled!=0; // "sound* | alert | mail"
107+
alertEnabled = alertEnabled!=0; // "sound* | alert* | mail"
108+
mailEnabled = mailEnabled!=0; // "sound | alert | mail"
109+
// "sound, alert, mail"
110+
if (autoConfig) { // "sound alert mail"
135111
string section = ifString(__isTesting, "Tester.", "") + ProgramName();
136112
signalTypes = GetConfigString(section, signalId +".Types", signalTypes);
137113
}
@@ -158,7 +134,6 @@ bool ConfigureSignalTypes(string signalId, string signalTypes, bool autoConfig,
158134
if (sValue == "sound") soundEnabled = true;
159135
else if (sValue == "alert") alertEnabled = true;
160136
else if (sValue == "mail" ) mailEnabled = true;
161-
else if (sValue == "sms" ) smsEnabled = true;
162137
else return(false);
163138
}
164139
}

mql40/include/rsf/functions/iCustom/HalfTrend.mqh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ double icHalfTrend(int timeframe, int periods, int iBuffer, int iBar) {
3333
"", // string Signal.onTrendChange.SoundDown
3434
false, // bool Signal.onTrendChange.Alert
3535
false, // bool Signal.onTrendChange.Mail
36-
false, // bool Signal.onTrendChange.SMS
3736

3837
"", // string ______________________________
3938
false, // bool AutoConfiguration

mql40/include/rsf/functions/iCustom/JMA.mqh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ double icJMA(int timeframe, int periods, int phase, string appliedPrice, int iBu
3131
"", // string Signal.onTrendChange.SoundDown
3232
false, // bool Signal.onTrendChange.Alert
3333
false, // bool Signal.onTrendChange.Mail
34-
false, // bool Signal.onTrendChange.SMS
3534

3635
"", // string ______________________________
3736
false, // bool AutoConfiguration

mql40/include/rsf/indicators/chartinfos/deinit.mqh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ int onDeinit() {
1313
// unregister the order event listener
1414
if (Track.Orders) {
1515
string name = orderTracker.key + StrToLower(Symbol());
16-
int counter = Max(GetPropA(hWndDesktop, name), 1) - 1;
17-
SetPropA(hWndDesktop, name, counter);
16+
int counter = Max(GetWindowPropertyA(hWndDesktop, name), 1) - 1;
17+
SetWindowPropertyA(hWndDesktop, name, counter);
1818
}
1919

2020
StoreStatus();

mql40/include/rsf/indicators/chartinfos/init.mqh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ int afterInit() {
129129
hWndDesktop = GetDesktopWindow();
130130
orderTracker.key = "rsf::order-tracker::"+ GetAccountNumber() +"::";
131131
string name = orderTracker.key + StrToLower(Symbol());
132-
int counter = Max(GetPropA(hWndDesktop, name), 0) + 1;
133-
SetPropA(hWndDesktop, name, counter);
132+
int counter = Max(GetWindowPropertyA(hWndDesktop, name), 0) + 1;
133+
SetWindowPropertyA(hWndDesktop, name, counter);
134134
}
135135

136136
// setup a chart ticker

mql40/include/rsf/stdfunctions.mqh

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -263,34 +263,34 @@ string ErrorDescription(int error) {
263263
/**
264264
* Replace all occurences of a substring in a string by another string.
265265
*
266-
* @param string str - string to process
266+
* @param string subject - string to process
267267
* @param string search - search string
268268
* @param string replace - replacement string
269269
* @param bool recursive [optional] - whether to replace recursively (default: no)
270270
*
271271
* @return string - resulting string or an empty string in case of errors
272272
*/
273-
string StrReplace(string str, string search, string replace, bool recursive = false) {
273+
string StrReplace(string subject, string search, string replace, bool recursive = false) {
274274
recursive = recursive!=0;
275-
if (!StringLen(str)) return(str);
276-
if (!StringLen(search)) return(str);
277-
if (search == replace) return(str);
275+
if (!StringLen(subject)) return(subject);
276+
if (!StringLen(search)) return(subject);
277+
if (search == replace) return(subject);
278278

279279
string result="", lastResult="";
280280

281281
if (!recursive) {
282-
int from=0, found=StringFind(str, search);
282+
int from=0, found=StringFind(subject, search);
283283

284284
while (found > -1) {
285-
result = StringConcatenate(result, StrSubstr(str, from, found-from), replace);
285+
result = StringConcatenate(result, StrSubstr(subject, from, found-from), replace);
286286
from = found + StringLen(search);
287-
found = StringFind(str, search, from);
287+
found = StringFind(subject, search, from);
288288
}
289-
result = StringConcatenate(result, StrSubstr(str, from));
289+
result = StringConcatenate(result, StrSubstr(subject, from));
290290
}
291291
else {
292292
int counter = 0;
293-
result = str;
293+
result = subject;
294294

295295
while (result != lastResult) {
296296
lastResult = result;
@@ -4503,7 +4503,7 @@ string GetAccountServer() {
45034503

45044504
if (serverName == "") {
45054505
// check main window properties
4506-
int lpString = GetPropA(hMainWnd, PROP_STRING_ACCOUNT_SERVER);
4506+
int lpString = GetWindowPropertyA(hMainWnd, PROP_STRING_ACCOUNT_SERVER);
45074507
if (lpString != NULL) serverName = GetStringA(lpString);
45084508
}
45094509

@@ -4527,8 +4527,8 @@ string GetAccountServer() {
45274527
// update EXECUTION_CONTEXT and main window properties
45284528
sAccountServer = ec_SetAccountServer(__ExecutionContext, serverName);
45294529
lpAccountServer = __ExecutionContext[EC.accountServer];
4530-
if (!GetPropA(hMainWnd, PROP_STRING_ACCOUNT_SERVER)) {
4531-
SetPropA(hMainWnd, PROP_STRING_ACCOUNT_SERVER, lpAccountServer);
4530+
if (!GetWindowPropertyA(hMainWnd, PROP_STRING_ACCOUNT_SERVER)) {
4531+
SetWindowPropertyA(hMainWnd, PROP_STRING_ACCOUNT_SERVER, lpAccountServer);
45324532
}
45334533

45344534
isRecursion = false;
@@ -4576,7 +4576,7 @@ int GetAccountNumber() {
45764576
// check main window properties
45774577
int hMainWnd = GetTerminalMainWindow();
45784578
if (!accountNumber) {
4579-
accountNumber = GetPropA(hMainWnd, PROP_INT_ACCOUNT_NUMBER);
4579+
accountNumber = GetWindowPropertyA(hMainWnd, PROP_INT_ACCOUNT_NUMBER);
45804580
}
45814581

45824582
// evaluate title bar of the main window
@@ -4595,7 +4595,7 @@ int GetAccountNumber() {
45954595

45964596
// update EXECUTION_CONTEXT and window properties
45974597
ec_SetAccountNumber(__ExecutionContext, accountNumber);
4598-
SetPropA(hMainWnd, PROP_INT_ACCOUNT_NUMBER, accountNumber);
4598+
SetWindowPropertyA(hMainWnd, PROP_INT_ACCOUNT_NUMBER, accountNumber);
45994599

46004600
isRecursion = false;
46014601
}
@@ -6544,7 +6544,6 @@ double icSuperTrend(int timeframe, int atrPeriods, int smaPeriods, int iBuffer,
65446544
"", // string Signal.onTrendChange.SoundDown
65456545
false, // bool Signal.onTrendChange.Alert
65466546
false, // bool Signal.onTrendChange.Mail
6547-
false, // bool Signal.onTrendChange.SMS
65486547

65496548
"", // string ______________________________
65506549
false, // bool AutoConfiguration
@@ -6924,13 +6923,11 @@ void __DummyCalls() {
69246923
int GetDlgCtrlID(int hWndCtl);
69256924
int GetDlgItem(int hDlg, int itemId);
69266925
int GetParent(int hWnd);
6927-
int GetPropA(int hWnd, string name);
69286926
int GetTopWindow(int hWnd);
69296927
int GetWindow(int hWnd, int cmd);
69306928
bool IsWindow(int hWnd);
69316929
int MessageBoxA(int hWnd, string text, string caption, int style);
69326930
bool PostMessageA(int hWnd, int msg, int wParam, int lParam);
69336931
int RegisterWindowMessageA(string str);
69346932
int SendMessageA(int hWnd, int msg, int wParam, int lParam);
6935-
bool SetPropA(int hWnd, string name, int hData);
69366933
#import

0 commit comments

Comments
 (0)