-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun.sh
More file actions
53 lines (45 loc) · 1.35 KB
/
run.sh
File metadata and controls
53 lines (45 loc) · 1.35 KB
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
#!/bin/bash
# This executes the run script
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Build the source code
# source $current_dir/environment.sh - no longer necessary
source $current_dir/clean.sh
source $current_dir/build.sh
# Debug: Check if the executable exists
if [ -f "$BUILD_DIR/$EXECUTABLE_NAME" ]; then
echo "Executable $EXECUTABLE_NAME found in $BUILD_DIR."
else
echo "Error: Executable $EXECUTABLE_NAME not found in $BUILD_DIR."
ls -la "$BUILD_DIR" # List the contents of the build directory for debugging
exit 1
fi
json='{
"RUN_ID": "UNIQUE_IDENTIFER",
"SYMBOLS": "EURUSD",
"LAST_MONTHS": 6,
"STRATEGY": {
"UUID": "",
"TRADING_VARIABLES": {
"STRATEGY": "OHLC_RSI",
"STOP_DISTANCE_IN_PIPS": 1,
"LIMIT_DISTANCE_IN_PIPS": 1,
"TRADING_SIZE": 1
},
"OHLC_VARIABLES": [
{
"OHLC_COUNT": 60,
"OHLC_MINUTES": 100
}
],
"STRATEGY_VARIABLES" : {
"OHLC_RSI_VARIABLES": {
"RSI_LONG": 60,
"RSI_SHORT": 40
}
}
}
}'
output=$(echo "$json" | base64)
# Step 6: Run the tests for now (/executable) from the root directory
# Passing two arguements, the destination of the QuestDB and the Strategy JSON (in base64)
./"$BUILD_DIR/$EXECUTABLE_NAME" 100.85.44.114 "$output"