Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7c5c0b8
remove obsolete input "EntryOrder.Distance"
rosasurfer Oct 13, 2025
813caa4
documentation
rosasurfer Oct 14, 2025
c3f71ec
update CI workflow
rosasurfer Oct 14, 2025
28ecaa3
refactor EA
rosasurfer Oct 14, 2025
c5ddb37
update status display
rosasurfer Oct 15, 2025
0e2384c
rename cmd EA.Start to EA.Entry and EA.Wait to EA.Start
rosasurfer Oct 16, 2025
65cd477
documentation
rosasurfer Oct 16, 2025
182250f
update chart templates
rosasurfer Nov 1, 2025
4bbcc43
update ShowStatus()
rosasurfer Nov 1, 2025
2564a21
improve error handling of CalculateStats()
rosasurfer Nov 1, 2025
b39a807
fix weekend trading errors in CalculateStats()
rosasurfer Nov 1, 2025
e27dfad
update command scripts
rosasurfer Nov 2, 2025
0198f6a
add EA command to toggle the display between absolute and percentage …
rosasurfer Nov 2, 2025
34d21ff
convert EOL
rosasurfer Nov 2, 2025
f88bf3e
update chart templates
rosasurfer Nov 2, 2025
1e89e67
move input ShowProfitInPercent to hotkey
rosasurfer Nov 2, 2025
9c47a48
bugfix in CountCalendarDays()
rosasurfer Nov 2, 2025
da474d5
fix typo
rosasurfer Nov 2, 2025
19836e7
bugfix if CalculateStats() is called in init()
rosasurfer Nov 2, 2025
1bc7797
rename EA.Entry to EA.EntrySignal
rosasurfer Nov 2, 2025
73f69c5
dynamically position the status box
rosasurfer Nov 2, 2025
b412ffb
rephrase command confirmations
rosasurfer Nov 3, 2025
17fa09a
update input default values
rosasurfer Nov 3, 2025
0a4f98f
minor updates
rosasurfer Nov 3, 2025
5550c2e
update chart templates
rosasurfer Nov 4, 2025
1dd70a7
update .gitattributes
rosasurfer Nov 4, 2025
f590217
fix sign of reported slippage
rosasurfer Nov 6, 2025
5f5928f
fix signaling of new MFE/MAE
rosasurfer Nov 7, 2025
9e5790f
remove obsolete tracking of max-lots/max-risk per custom position
rosasurfer Nov 7, 2025
43f4594
fix MFE/MAE signaling issues
rosasurfer Nov 7, 2025
cd4a158
show avg percent/trade if profit-in-percent is active
rosasurfer Nov 7, 2025
fd55a53
start new online instance in status "stopped"
rosasurfer Nov 7, 2025
3c98fa4
update instance name
rosasurfer Nov 8, 2025
332df8b
disregard
rosasurfer Nov 8, 2025
3f98883
add helper GetPressedVirtualKeys()
rosasurfer Nov 8, 2025
55fed6b
chart commands support integer modifiers
rosasurfer Nov 8, 2025
9ba86bb
add support for flag F_VK_ALL
rosasurfer Nov 9, 2025
0a8ba28
adjust status and logfile names
rosasurfer Nov 9, 2025
1e2ed04
rename GetStatusFilenameData() to GetStatusFileNameData()
rosasurfer Nov 9, 2025
e69eda9
drop obsolete GetStatusFileNameData()
rosasurfer Nov 10, 2025
6977a13
update signal messages
rosasurfer Nov 10, 2025
f65d172
update chart templates
rosasurfer Nov 14, 2025
f1f248d
bugfix in CreateInstanceId()
rosasurfer Nov 23, 2025
8c7ff27
fix parsing of compiler messages
rosasurfer Nov 23, 2025
fbece26
convert some warnings to info
rosasurfer Nov 23, 2025
b588c3f
fix call of AddHistoryRecord()
rosasurfer Nov 28, 2025
fe4b840
stop the sequence after ERR_CONCURRENT_MODIFICATION
rosasurfer Nov 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 11 additions & 29 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,37 +1,19 @@
# default: self-detect the content type (text vs. binary)
* text=auto


# enforce content type "text" to fix mixed line-endings in the repo
*.h text
*.htm text
*.html text
*.ini text
*.md text
*.mq4 text
*.mq5 text
*.mqh text
*.sh text
*.txt text


# set content encodings
* encoding=UTF-8
*.mqh encoding=CP1252
*.mq4 encoding=CP1252
*.mq5 encoding=CP1252
*.tpl encoding=CP1252
* encoding=UTF-8
*.mqh encoding=CP1252 text
*.mq4 encoding=CP1252 text
*.mq5 encoding=CP1252 text
*.tpl encoding=CP1252 text


# checkout with Windows line-endings (not yet supported by EGit)
*.tpl text eol=crlf
hotkeys.ini text eol=crlf
hotkeys.ini text eol=crlf


# Gitgub Linguist overrides
/etc/** linguist-detectable=false
/files/** linguist-detectable=false
/sounds/** linguist-detectable=false
/templates/** linguist-detectable=false
*.mqh linguist-language=MQL4

/etc/** linguist-detectable=false
/files/** linguist-detectable=false
/sounds/** linguist-detectable=false
/templates/** linguist-detectable=false
*.mqh linguist-language=MQL4
1 change: 0 additions & 1 deletion .github/workflows/compile-mql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ jobs:
-d 'artifact-id=${{ steps.artifact.outputs.artifact-id }}')"
echo "HTTP status: $status"
cat "$response_file"

((status >= 400)) && exit 1 || :

# ------------------------------------------------------------------------------------------------------------------------------------
57 changes: 35 additions & 22 deletions bin/mqlc
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,16 @@ function compareDirs() {
# @param $3 - include directory
#
function compileMql40() {
local srcFile="$1" version="$2" include="$3" s_compiler s_srcFile
local compiler errorStatus=0 startms endms time='' output=() line errors=0 epl='' warnings=0 wpl='' retVal
local srcFile="$1" version="$2" include="$3" s_compiler s_srcFile logFile
local compiler errorStatus=0 startms endms time='' output=() line i errors=0 epl='' warnings=0 wpl='' retVal

((originalOutput)) || echo "Compiling \"$srcFile\" as $(versionName "$version")"

# compose compiler command
setCompilerPath 'compiler' "$version" "$include"
[[ "$compiler" == /* ]] && compiler="$(cygpath -w "$compiler")"
[[ "$srcFile" == /* ]] && srcFile="$(cygpath -w "$srcFile")"
logFile="${srcFile%.*}.log"
((debug)) && {
[[ "$compiler" == *\ * ]] && s_compiler="\"$compiler\"" || s_compiler="$compiler"
[[ "$srcFile" == *\ * ]] && s_srcFile="\"$srcFile\"" || s_srcFile="$srcFile"
Expand All @@ -289,12 +290,20 @@ function compileMql40() {
# on success
if ((!errorStatus)); then
[[ "${output[-1]}" =~ ^(Exp|Library exp)\ file\ .+\ produced\ -\ ([0-9]+)\ error.+\ ([0-9]+)\ warning.+ ]] || {
fail "unexpected compiler output in last line: \"${output[-1]}\"";
fail "unexpected compiler output in last line:${NL}${output[-1]}";
}
errors="${BASH_REMATCH[2]}"; ((errors == 1)) && epl='' || epl='s'
warnings="${BASH_REMATCH[3]}"; ((warnings == 1)) && wpl='' || wpl='s'
errors="${BASH_REMATCH[2]}"
warnings="${BASH_REMATCH[3]}"

if ((!originalOutput)); then
# reset some warnings
for ((i=3; i < ${#output[@]}; ++i)); do
[[ "${output[i]}" == '1;'* ]] && [[ "${output[i]}" == *'is not referenced and will be removed from exp-file' ]] && ((--warnings))
done

# add final results
((errors == 1)) && epl='' || epl='s'
((warnings == 1)) && wpl='' || wpl='s'
time="$(duration "$startms" "$endms")"
output[-1]="Result: $errors error$epl, $warnings warning$wpl, $time elapsed"
((!warnings)) && output+=('Success')
Expand All @@ -310,9 +319,8 @@ function compileMql40() {
((++errors))
else
# count errors and warnings
local i
for ((i=3; i < ${#output[@]}; ++i)); do
[[ "${output[i]}" == '1;'* ]] && ((++warnings))
[[ "${output[i]}" == '1;'* ]] && [[ "${output[i]}" != *'is not referenced and will be removed from exp-file' ]] && ((++warnings))
[[ "${output[i]}" == '2;'* ]] && ((++errors))
done
fi
Expand Down Expand Up @@ -349,6 +357,7 @@ function compileMql40() {
printf '%s\n' "${output[@]}"

((warn2error)) || warnings=0
((!errors && !warnings)) && rm -f "$logFile"
((retVal = errors + warnings))
((retVal > 255)) && retVal=255
return "$retVal"
Expand Down Expand Up @@ -434,33 +443,38 @@ function compileMql5() {
#
# Reformat a single log message produced by the MQL4.0 compiler.
#
# @param _InOut_ $1 - named reference to the log message
# @param _InOut_ $1 - reference to the log message
# @param _In_ $2 - source file of the compilation
# @param _In_ $3 - number of errors during the compilation
# @param _In_ $4 - number of warnings during the compilation
# @param _In_ $3 - number of errors during compilation
# @param _In_ $4 - number of warnings during compilation
#
function formatCompiler40Msg() {
((BASH_SUBSHELL)) && fail "${FUNCNAME[0]}() can't write to outer scope from subshell"
local -n logmsg="$1"
local srcFile="$2" errors="$3" warnings="$4" type code level levelS file location message len
local srcFile="$2" errors="$3" warnings="$4" type code level levelS file line location='' message len

[[ "$logmsg" =~ ^([0-9]+)\;([0-9]+)\;(.+)\;([0-9]+:[0-9]+)?\;(.*)$ ]] || fail "unexpected format of compiler message:$NL\"$logmsg\""
[[ "$logmsg" =~ ^([0-9]+)\;([0-9]+)\;(.+)?\;([0-9]+:[0-9]+)?\;(.*)$ ]] || fail "unexpected format of compiler message:${NL}${logmsg}"
type="${BASH_REMATCH[1]}"
code="${BASH_REMATCH[2]}"
file="${BASH_REMATCH[3]}"
location="${BASH_REMATCH[4]}"
line="${BASH_REMATCH[4]}"
message="${BASH_REMATCH[5]}"

[[ "$type" == [12] ]] || fail "unexpected message type $type in compiler message:$NL\"$logmsg\""
((type == 1)) && level='warn' || level='error'
[[ "$type" == [12] ]] || fail "unexpected message type $type in compiler message:${NL}${logmsg}"
if ((type == 1)); then
[[ "$message" == *'is not referenced and will be removed from exp-file' ]] && level='info' || level='warn'
else
level='error'
fi
((errors)) && len=6 || len=5
levelS="$level: "
levelS="${levelS:0:$len}"

[[ -n "$location" ]] && location=" ($location)"

logmsg="${levelS} ${file}${location}: ${message}"
#logmsg="${file}${location}: ${level}: ${message}"
if [[ -n "$file" ]]; then
[[ -n "$line" ]] && line=" ($line)"
location="${file}${line}: "
fi
logmsg="${levelS} ${location}${message}"
}


Expand Down Expand Up @@ -1186,15 +1200,14 @@ metalang.exe
1=warn
2=error

2 ; 124 ; C:\z\F\Projects\mt4\mql\bin\Dow Jones Breakout.mq4 ; 146:12 ; 'HandleCommand' - function is not defined
1 ; 33 ; C:\z\F\Projects\mt4\mql\bin\Dow Jones Breakout.mq4 ; 149:8 ; '5' - comparison expression expected
2 ; 89 ; C:\z\F\Projects\mt4\mql\bin\Dow Jones Breakout.mq4 ; 526:1 ; '\end_of_program' - unbalanced left parenthesis
2 ; 124 ; C:\z\F\Projects\mt4\mql\bin\Dow Jones Breakout.mq4 ; 146:12 ; 'HandleCommand' - function is not defined
2 ; 114 ; C:\z\F\Projects\mt4\mql\bin\output.txt ; 11:53 ; 'some text' - more than 1 symbol
1 ; 41 ; C:\z\F\Projects\mt4\mql\bin\metalang.exe ; 1:1 ; 'MZ???' - expression on global scope not allowed
2 ; 75 ; C:\z\F\Projects\mt4\mql\bin\metalang.exe ; 1:1 ; 'MZ???' - variable not defined
2 ; 76 ; ; ; cannot open the source file
2 ; 52 ; ; ; cannot open the output file

1 ; 39 ; ; ; Function "Foo" is not referenced and will be removed from exp-file

metaeditor.exe
--------------
Expand Down
2 changes: 1 addition & 1 deletion config/hotkeys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Chart.ToggleTradeHistory=Alt+H
Chart.ToggleUnitSize=Alt+D
Config=Alt+C
EA.ToggleMetrics=Alt+M
EA.TogglePercent=Alt+P
Empty=Ctrl+P
MarketWatch.Symbols=Ctrl+S
ParameterStepper.Down=Alt+L
Expand All @@ -20,4 +21,3 @@ ReopenAlerts=Alt+A
SuperBars.TimeframeDown=Ctrl+L
SuperBars.TimeframeUp=Ctrl+K
</scripts>

Loading