-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen.sh
executable file
·66 lines (51 loc) · 1.38 KB
/
gen.sh
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
#!/usr/bin/env bash
if [[ $# == 2 ]]; then
out_dir=$1
indi="$2"
elif [[ -f $1 ]]; then
out_dir=`basename $(dirname $1)`
indi=`basename $1`
elif [[ -f confirm/generate/$1 ]]; then
out_dir=`basename $(dirname $1)`
indi=`basename $1`
else
echo "something went wrong with the params"
exit 1
fi
echo "$indi"
# if [[ ! -f config/generate/$1/$2 ]]; then
# echo config/generate/$1/$2 does not exist
# exit 1
# fi
RUST_BACKTRACE=1
RUST_LOG=debug
workdir="/home/stefan/.wine/drive_c/Program Files/MetaTrader 5"
# generate the signal
cargo run -- gen -i config/indicator/$out_dir config/generate/$out_dir/$indi
if [[ $? != 0 ]]; then
echo -e "\ngenerate failed"
exit 1
fi
pushd "$workdir"
# watch the compiler output
tail -Fn0 MQL5/Experts/BacktestExpert/nnfx-ea/nnfx-ea.log &
# grep --color=always i error &
tail_pid=$!
# compile the EA
wine64 ~/.wine/drive_c/Program\ Files/MetaTrader\ 5/metaeditor64.exe \
/compile:"MQL5/Experts/BacktestExpert/nnfx-ea/nnfx-ea.mq5" \
/include:"MQL5" \
/log \
&>/dev/null
ret=$?
kill %%
wait
if [[ $ret == 0 ]]; then
echo -e "\ncompilation failed"
exit 1
fi
popd
command cp -f config/run_test.yaml /tmp/run.yaml
echo " confirm: config/indicator/$out_dir/$indi" >> /tmp/run.yaml
# run a single backtest with the new signal as confirmation
cargo run -- -c config/config_single.yaml run /tmp/run.yaml