Merge pull request #14 from tef-github/minor_fixes

minor typo fixes and refactoring implemented
This commit is contained in:
tef-github 2022-02-12 11:57:55 -05:00 committed by GitHub
commit f0720233cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 9 deletions

View File

@ -20,7 +20,7 @@ from user_data.strategies.notifier import send_start_deliminator_message
class Strategy002(IStrategy):
if Config.IS_BACKTEST:
send_start_deliminator_message('Freq Strategy002 ',Config.BACKTEST_COIN ,Config.BACKTEST_MONTH_LIST[Config.BACKTEST_DATA_CLEANER_MONTH_INDEX], Config.BACKTEST_DATA_CLEANER_YEAR)
send_start_deliminator_message('Freq Strategy002 ',Config.BACKTEST_COIN ,Config.BACKTEST_MONTH_LIST[Config.BACKTEST_DATA_CLEANER_MONTH_INDEX], Config.BACKTEST_DATA_CLEANER_YEAR, Config.BACKTEST_DUP, Config.BACKTEST_MAX_COUNT_DUP)
"""
Strategy 002
author@: Gerald Lonlas

View File

@ -20,7 +20,7 @@ from user_data.strategies.notifier import send_start_deliminator_message
class Strategy003(IStrategy):
if Config.IS_BACKTEST:
send_start_deliminator_message('Freq Strategy003 ',Config.BACKTEST_COIN ,Config.BACKTEST_MONTH_LIST[Config.BACKTEST_DATA_CLEANER_MONTH_INDEX], Config.BACKTEST_DATA_CLEANER_YEAR)
send_start_deliminator_message('Freq Strategy003 ',Config.BACKTEST_COIN ,Config.BACKTEST_MONTH_LIST[Config.BACKTEST_DATA_CLEANER_MONTH_INDEX], Config.BACKTEST_DATA_CLEANER_YEAR, Config.BACKTEST_DUP, Config.BACKTEST_MAX_COUNT_DUP)
"""
Strategy 003
author@: Gerald Lonlas

View File

@ -17,7 +17,7 @@ from user_data.strategies.notifier import send_start_deliminator_message
class Strategy004(IStrategy):
if Config.IS_BACKTEST:
send_start_deliminator_message('Freq Strategy004 ', Config.BACKTEST_COIN ,Config.BACKTEST_MONTH_LIST[Config.BACKTEST_DATA_CLEANER_MONTH_INDEX], Config.BACKTEST_DATA_CLEANER_YEAR)
send_start_deliminator_message('Freq Strategy004 ',Config.BACKTEST_COIN ,Config.BACKTEST_MONTH_LIST[Config.BACKTEST_DATA_CLEANER_MONTH_INDEX], Config.BACKTEST_DATA_CLEANER_YEAR, Config.BACKTEST_DUP, Config.BACKTEST_MAX_COUNT_DUP)
"""
Strategy 004
author@: Gerald Lonlas

View File

@ -1,8 +1,12 @@
class Config:
BACKTEST_DUP = '0.35'
BACKTEST_MAX_COUNT_DUP = '3'
BACKTEST_DOWNLOADED_JSON_DATA_FILE_PATH = ""
BACKTEST_DATA_CLEANER_YEAR = 2020
BACKTEST_DATA_CLEANER_MONTH_INDEX = 9
BACKTEST_COIN = 'BTC'
BACKTEST_MONTH_LIST = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
BACKTEST_DATA_CLEANER_YEAR = 2021
BACKTEST_DATA_CLEANER_MONTH_INDEX = 4
IS_BACKTEST = False
IS_EXECUTION = True
WORKSPACE_PATH = "workspace2" if IS_BACKTEST else "workspace"

View File

@ -1,12 +1,14 @@
EXECUTION_PATH = '/root/workspace2/execution' # do not move this to config.py
import requests
import sys
sys.path.append(Config.EXECUTION_PATH)
sys.path.append(EXECUTION_PATH)
from config import Config
def send_start_deliminator_message(brain, coin, month, year):
def send_start_deliminator_message(brain, coin, month, year, dup, max_counter_dup):
print("notifier: send_start_deliminator_message: ")
text = "========" + str(brain) + str(coin) + " " + str(month) + " " + str(year) + "=======>"
text = "========" + str(brain) + " DUP = " + str(dup) + " MAX_COUNTER_DUP = " + max_counter_dup + " " + str(coin) + " " + str(month) + " " + str(year) + "=======>"
result = requests.post('https://api.telegram.org/bot' + Config.NOTIFIER_TELEGRAM_BOT_API_TOKEN_BACKTEST +
'/sendMessage?chat_id=' + Config.NOTIFIER_TELEGRAM_CHANNEL_ID_BACKTEST + '&text=' + text + '&parse_mode=Markdown')

View File

@ -15,7 +15,7 @@ def _perform_execute(mode, coin, brain):
def _perform_back_test(date_time, coin, brain):
date = str(date_time)
date = date.replace(" ", "#")
subprocess.call("python3 "+ Config.EXECUTION_PATH + "back_tester.py " + date + " " + coin + " " + brain + " 0.45 3", shell=True)
subprocess.call("python3 "+ Config.EXECUTION_PATH + "back_tester.py " + date + " " + coin + " " + brain + " " + Config.BACKTEST_DUP + " " + Config.BACKTEST_MAX_COUNT_DUP, shell=True)
def back_test(date_time, coin, brain):
time.sleep(Config.BACKTEST_THROTTLE_SECOND)