fixed some format issues and added better logging

This commit is contained in:
Gert Wohlgemuth 2018-05-24 16:04:51 -07:00
parent e37e7bd914
commit beb45bc58f
2 changed files with 7 additions and 3 deletions

View File

@ -63,11 +63,15 @@ def backtest(event, context):
if 'from' in event['body']: if 'from' in event['body']:
yesterday = datetime.datetime.strptime(event['body']['from'], '%Y%m%d') yesterday = datetime.datetime.strptime(event['body']['from'], '%Y%m%d')
if 'till' in event['body']: if 'till' in event['body']:
yesterday = datetime.datetime.strptime(event['body']['till'], '%Y%m%d') today = datetime.datetime.strptime(event['body']['till'], '%Y%m%d')
try: try:
if "Items" in response and len(response['Items']) > 0: if "Items" in response and len(response['Items']) > 0:
print("backtesting from {} till {} for {} with {} vs {}".format(yesterday, today, name,
response['Items'][0][
'stake_currency'],
response['Items'][0]['assets']))
content = response['Items'][0]['content'] content = response['Items'][0]['content']
configuration = { configuration = {
"max_open_trades": 1, "max_open_trades": 1,

View File

@ -70,8 +70,8 @@ class MyFancyTestStrategy(IStrategy):
request = { request = {
"user": "GCU4LW2XXZW3A3FM2XZJTEJHNWHTWDKY2DIJLCZJ5ULVZ4K7LZ7D23TG", "user": "GCU4LW2XXZW3A3FM2XZJTEJHNWHTWDKY2DIJLCZJ5ULVZ4K7LZ7D23TG",
"name": "MyFancyTestStrategy", "name": "MyFancyTestStrategy",
"from": "20180501", "from": "20180401",
"till": "20180401" "till": "20180501"
} }