Merge pull request #14 from tef-github/minor_fixes
minor typo fixes and refactoring implemented
This commit is contained in:
commit
f0720233cc
@ -20,7 +20,7 @@ from user_data.strategies.notifier import send_start_deliminator_message
|
|||||||
|
|
||||||
class Strategy002(IStrategy):
|
class Strategy002(IStrategy):
|
||||||
if Config.IS_BACKTEST:
|
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
|
Strategy 002
|
||||||
author@: Gerald Lonlas
|
author@: Gerald Lonlas
|
||||||
|
@ -20,7 +20,7 @@ from user_data.strategies.notifier import send_start_deliminator_message
|
|||||||
|
|
||||||
class Strategy003(IStrategy):
|
class Strategy003(IStrategy):
|
||||||
if Config.IS_BACKTEST:
|
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
|
Strategy 003
|
||||||
author@: Gerald Lonlas
|
author@: Gerald Lonlas
|
||||||
|
@ -17,7 +17,7 @@ from user_data.strategies.notifier import send_start_deliminator_message
|
|||||||
|
|
||||||
class Strategy004(IStrategy):
|
class Strategy004(IStrategy):
|
||||||
if Config.IS_BACKTEST:
|
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
|
Strategy 004
|
||||||
author@: Gerald Lonlas
|
author@: Gerald Lonlas
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
class Config:
|
class Config:
|
||||||
|
|
||||||
|
BACKTEST_DUP = '0.35'
|
||||||
|
BACKTEST_MAX_COUNT_DUP = '3'
|
||||||
BACKTEST_DOWNLOADED_JSON_DATA_FILE_PATH = ""
|
BACKTEST_DOWNLOADED_JSON_DATA_FILE_PATH = ""
|
||||||
BACKTEST_DATA_CLEANER_YEAR = 2020
|
BACKTEST_COIN = 'BTC'
|
||||||
BACKTEST_DATA_CLEANER_MONTH_INDEX = 9
|
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_BACKTEST = False
|
||||||
IS_EXECUTION = True
|
IS_EXECUTION = True
|
||||||
WORKSPACE_PATH = "workspace2" if IS_BACKTEST else "workspace"
|
WORKSPACE_PATH = "workspace2" if IS_BACKTEST else "workspace"
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
|
EXECUTION_PATH = '/root/workspace2/execution' # do not move this to config.py
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import sys
|
import sys
|
||||||
sys.path.append(Config.EXECUTION_PATH)
|
sys.path.append(EXECUTION_PATH)
|
||||||
from config import Config
|
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: ")
|
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 +
|
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')
|
'/sendMessage?chat_id=' + Config.NOTIFIER_TELEGRAM_CHANNEL_ID_BACKTEST + '&text=' + text + '&parse_mode=Markdown')
|
||||||
|
@ -15,7 +15,7 @@ def _perform_execute(mode, coin, brain):
|
|||||||
def _perform_back_test(date_time, coin, brain):
|
def _perform_back_test(date_time, coin, brain):
|
||||||
date = str(date_time)
|
date = str(date_time)
|
||||||
date = date.replace(" ", "#")
|
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):
|
def back_test(date_time, coin, brain):
|
||||||
time.sleep(Config.BACKTEST_THROTTLE_SECOND)
|
time.sleep(Config.BACKTEST_THROTTLE_SECOND)
|
||||||
|
Loading…
Reference in New Issue
Block a user