Merge branch 'aws' of https://github.com/berlinguyinca/freqtrade into aws
This commit is contained in:
commit
c5ab479c32
@ -215,7 +215,7 @@ def _store_aggregated_data(interval, name, result, timerange, user):
|
||||
"losses": row[6],
|
||||
"wins": row[5],
|
||||
"duration": row[4],
|
||||
"profit_percent": row[2],
|
||||
"profit_percent": row[2]
|
||||
}
|
||||
|
||||
print(data)
|
||||
|
@ -199,7 +199,6 @@ def __evaluate(data):
|
||||
data['type'] = "strategy"
|
||||
data['roi'] = strat.minimal_roi
|
||||
data['stoploss'] = strat.stoploss
|
||||
data['ticker'] = strat.ticker_interval
|
||||
|
||||
# ensure that the modified file is saved
|
||||
data['content'] = urlsafe_b64encode(strategy.encode('utf-8'))
|
||||
|
@ -1,7 +1,7 @@
|
||||
import boto3
|
||||
import simplejson as json
|
||||
import os
|
||||
from freqtrade.aws.tables import get_trade_table
|
||||
from freqtrade.aws.tables import get_trade_table, get_strategy_table
|
||||
from boto3.dynamodb.conditions import Key, Attr
|
||||
|
||||
|
||||
@ -15,7 +15,24 @@ def store(event, context):
|
||||
for x in event['Records']:
|
||||
if 'Sns' in x and 'Message' in x['Sns']:
|
||||
data = json.loads(x['Sns']['Message'], use_decimal=True)
|
||||
get_trade_table().put_item(Item=data)
|
||||
|
||||
table = get_strategy_table()
|
||||
|
||||
response = table.query(
|
||||
KeyConditionExpression=Key('user').eq(data['user']) &
|
||||
Key('name').eq(data['strategy'])
|
||||
)
|
||||
|
||||
if "Items" in response and len(response['Items']) > 0:
|
||||
item = response['Items'][0]
|
||||
|
||||
data['strategy'] = {
|
||||
"name": item['name'],
|
||||
"user": item['user'],
|
||||
"public": item['public']
|
||||
}
|
||||
|
||||
get_trade_table().put_item(Item=data)
|
||||
|
||||
|
||||
def submit(event, context):
|
||||
|
Loading…
Reference in New Issue
Block a user