From a9db7e087fbc7fa2d9e1590001c98f3e4e7f31fe Mon Sep 17 00:00:00 2001 From: Petr Vlasak Date: Tue, 27 Feb 2024 18:15:35 +0100 Subject: [PATCH 1/5] changed VIRTUAL_ENV_DIR and PYTHON_TO_USE --- run.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run.sh b/run.sh index b4c1cf2..031649f 100755 --- a/run.sh +++ b/run.sh @@ -19,10 +19,10 @@ OUTPUT_PID_FILE=running.pid OUTPUT_PID_PATH=$HOME -PYTHON_TO_USE="python3" +PYTHON_TO_USE="python" # If using 'virtualenv' with python, specify the local virtualenv dir. -#VIRTUAL_ENV_DIR="" +VIRTUAL_ENV_DIR="/c/Projects/v2trading_clone/petr_venv" #----END EDITABLE VARS------- @@ -34,7 +34,7 @@ BACKUP_LOG_FILE="$HISTORY_DIR/${TIMESTAMP}_$LOG_FILE" # If virtualenv specified & exists, using that version of python instead. if [ -d "$VIRTUAL_ENV_DIR" ]; then - PYTHON_TO_USE="$VIRTUAL_ENV_DIR/bin/python" + PYTHON_TO_USE="$VIRTUAL_ENV_DIR/Scripts/python" fi start() { From d63a6b7897ecf9f28de80e30e64915442e2c9359 Mon Sep 17 00:00:00 2001 From: Petr Vlasak Date: Wed, 28 Feb 2024 08:04:02 +0100 Subject: [PATCH 2/5] user_data_dir function has a second parameter author, ACCOUNT1_LIVE has still PAPER_API_KEY and SECRET_KEY --- v2realbot/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v2realbot/config.py b/v2realbot/config.py index 79ce425..43dd655 100644 --- a/v2realbot/config.py +++ b/v2realbot/config.py @@ -62,7 +62,7 @@ BT_FILL_PRICE_MARKET_ORDER_PREMIUM = 0.005 COUNT_API_REQUESTS = False #stratvars that cannot be changed in gui STRATVARS_UNCHANGEABLES = ['pendingbuys', 'blockbuy', 'jevylozeno', 'limitka'] -DATA_DIR = user_data_dir("v2realbot") +DATA_DIR = user_data_dir("v2realbot", "david") MODEL_DIR = Path(DATA_DIR)/"models" #BT DELAYS #profiling @@ -152,8 +152,8 @@ except ValueError: ACCOUNT1_PAPER_FEED = DataFeed.SIP #PRIMARY LIVE -ACCOUNT1_LIVE_API_KEY = os.environ.get('ACCOUNT1_LIVE_API_KEY') -ACCOUNT1_LIVE_SECRET_KEY = os.environ.get('ACCOUNT1_LIVE_SECRET_KEY') +ACCOUNT1_LIVE_API_KEY = os.environ.get('ACCOUNT1_PAPER_API_KEY') +ACCOUNT1_LIVE_SECRET_KEY = os.environ.get('ACCOUNT1_PAPER_SECRET_KEY') ACCOUNT1_LIVE_MAX_BATCH_SIZE = 1 ACCOUNT1_LIVE_PAPER = False #ACCOUNT1_LIVE_FEED = DataFeed.SIP From 5136279eb57311f972c8246bbf9ab4eb32294dfe Mon Sep 17 00:00:00 2001 From: Petr Vlasak Date: Wed, 28 Feb 2024 08:08:21 +0100 Subject: [PATCH 3/5] line 29 has deleted integrity and crossorigin value --- v2realbot/static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2realbot/static/index.html b/v2realbot/static/index.html index 0cf8e13..f5a825c 100644 --- a/v2realbot/static/index.html +++ b/v2realbot/static/index.html @@ -26,7 +26,7 @@ - + From d3236d27a6e1203e3e5e6d4299c84f6b40c3239b Mon Sep 17 00:00:00 2001 From: Petr Vlasak Date: Mon, 4 Mar 2024 16:57:10 +0100 Subject: [PATCH 4/5] primary live account api and secret changed --- v2realbot/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2realbot/config.py b/v2realbot/config.py index 43dd655..fd23e89 100644 --- a/v2realbot/config.py +++ b/v2realbot/config.py @@ -152,8 +152,8 @@ except ValueError: ACCOUNT1_PAPER_FEED = DataFeed.SIP #PRIMARY LIVE -ACCOUNT1_LIVE_API_KEY = os.environ.get('ACCOUNT1_PAPER_API_KEY') -ACCOUNT1_LIVE_SECRET_KEY = os.environ.get('ACCOUNT1_PAPER_SECRET_KEY') +ACCOUNT1_LIVE_API_KEY = os.environ.get('ACCOUNT1_LIVE_API_KEY') +ACCOUNT1_LIVE_SECRET_KEY = os.environ.get('ACCOUNT1_LIVE_SECRET_KEY') ACCOUNT1_LIVE_MAX_BATCH_SIZE = 1 ACCOUNT1_LIVE_PAPER = False #ACCOUNT1_LIVE_FEED = DataFeed.SIP From 0f65ce3dc3571d8313110a9041dfe5e5b893486b Mon Sep 17 00:00:00 2001 From: David Brazda Date: Mon, 4 Mar 2024 17:01:47 +0100 Subject: [PATCH 5/5] Delete run.sh --- run.sh | 106 --------------------------------------------------------- 1 file changed, 106 deletions(-) delete mode 100755 run.sh diff --git a/run.sh b/run.sh deleted file mode 100755 index 031649f..0000000 --- a/run.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash - -# file: runstop.sh - -#---- -# Simple script to start / stop / restart a python script in the background. -#---- - -#---- -# To Use: -# Run "./run.sh start" to start, "./run.sh stop" to stop, and "./run.sh restart" to restart. -#---- - -#----BEGIN EDITABLE VARS---- - -SCRIPT_TO_EXECUTE_PLUS_ARGS='v2realbot/main.py -u' - -OUTPUT_PID_FILE=running.pid - -OUTPUT_PID_PATH=$HOME - -PYTHON_TO_USE="python" - -# If using 'virtualenv' with python, specify the local virtualenv dir. -VIRTUAL_ENV_DIR="/c/Projects/v2trading_clone/petr_venv" - -#----END EDITABLE VARS------- - -# Additions for handling strat.log backup -HISTORY_DIR="$HOME/stratlogs" -TIMESTAMP=$(date +"%Y%m%d-%H%M%S") -LOG_FILE="strat.log" -BACKUP_LOG_FILE="$HISTORY_DIR/${TIMESTAMP}_$LOG_FILE" - -# If virtualenv specified & exists, using that version of python instead. -if [ -d "$VIRTUAL_ENV_DIR" ]; then - PYTHON_TO_USE="$VIRTUAL_ENV_DIR/Scripts/python" -fi - -start() { - # Check and create history directory if it doesn't exist - [ ! -d "$HISTORY_DIR" ] && mkdir -p "$HISTORY_DIR" - - # Check if strat.log exists and back it up - if [ -f "$LOG_FILE" ]; then - mv "$LOG_FILE" "$BACKUP_LOG_FILE" - echo "Backed up log to $BACKUP_LOG_FILE" - fi - - if [ ! -e "$OUTPUT_PID_PATH/$OUTPUT_PID_FILE" ]; then - nohup "$PYTHON_TO_USE" ./$SCRIPT_TO_EXECUTE_PLUS_ARGS > strat.log 2>&1 & echo $! > "$OUTPUT_PID_PATH/$OUTPUT_PID_FILE" - echo "Started $SCRIPT_TO_EXECUTE_PLUS_ARGS @ Process: $!" - sleep .7 - echo "Created $OUTPUT_PID_FILE file in $OUTPUT_PID_PATH dir" - else - echo "$SCRIPT_TO_EXECUTE_PLUS_ARGS is already running." - fi -} - -stop() { - if [ -e "$OUTPUT_PID_PATH/$OUTPUT_PID_FILE" ]; then - the_pid=$(<$OUTPUT_PID_PATH/$OUTPUT_PID_FILE) - rm "$OUTPUT_PID_PATH/$OUTPUT_PID_FILE" - echo "Deleted $OUTPUT_PID_FILE file in $OUTPUT_PID_PATH dir" - kill "$the_pid" - COUNTER=1 - while [ -e /proc/$the_pid ] - do - echo "$SCRIPT_TO_EXECUTE_PLUS_ARGS @: $the_pid is still running" - sleep .7 - COUNTER=$[$COUNTER +1] - if [ $COUNTER -eq 20 ]; then - kill -9 "$the_pid" - fi - if [ $COUNTER -eq 40 ]; then - exit 1 - fi - done - echo "$SCRIPT_TO_EXECUTE_PLUS_ARGS @: $the_pid has finished" - else - echo "$SCRIPT_TO_EXECUTE_PLUS_ARGS is not running." - fi -} - -restart() { - stop - sleep 1 - start -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - *) - echo "Usage: $0 {start|stop|restart}" - exit 1 -esac - -exit 0