Merge branch 'aws' of https://github.com/berlinguyinca/freqtrade into aws
This commit is contained in:
commit
f18d04b0a4
@ -56,6 +56,7 @@ def backtest(event, context):
|
|||||||
)
|
)
|
||||||
|
|
||||||
print(response)
|
print(response)
|
||||||
|
try:
|
||||||
if "Items" in response and len(response['Items']) > 0:
|
if "Items" in response and len(response['Items']) > 0:
|
||||||
|
|
||||||
today = datetime.datetime.today()
|
today = datetime.datetime.today()
|
||||||
@ -103,16 +104,10 @@ def backtest(event, context):
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print("generated configuration")
|
|
||||||
print(configuration)
|
|
||||||
|
|
||||||
print("initialized backtesting")
|
print("initialized backtesting")
|
||||||
backtesting = Backtesting(configuration)
|
backtesting = Backtesting(configuration)
|
||||||
result = backtesting.start()
|
result = backtesting.start()
|
||||||
print("finished test")
|
print("finished test")
|
||||||
|
|
||||||
print("persist data in dynamo")
|
|
||||||
|
|
||||||
print(result)
|
print(result)
|
||||||
result_data = []
|
result_data = []
|
||||||
for index, row in result.iterrows():
|
for index, row in result.iterrows():
|
||||||
@ -140,8 +135,18 @@ def backtest(event, context):
|
|||||||
"body": json.dumps(result_data)
|
"body": json.dumps(result_data)
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
raise Exception(
|
return {
|
||||||
"sorry we did not find any matching strategy for user {} and name {}".format(user, name))
|
"statusCode": 404,
|
||||||
|
"body": json.dumps({
|
||||||
|
"error": "sorry we did not find any matching strategy for user {} and name {}".format(
|
||||||
|
user, name)})
|
||||||
|
}
|
||||||
|
|
||||||
|
except ImportError as e:
|
||||||
|
return {
|
||||||
|
"statusCode": 500,
|
||||||
|
"body": json.dumps({"error": e})
|
||||||
|
}
|
||||||
else:
|
else:
|
||||||
raise Exception("not a valid event: {}".format(event))
|
raise Exception("not a valid event: {}".format(event))
|
||||||
|
|
||||||
|
@ -35,6 +35,12 @@ provider:
|
|||||||
deploymentBucket:
|
deploymentBucket:
|
||||||
name: lambdas-freq
|
name: lambdas-freq
|
||||||
|
|
||||||
|
# limit the invocations a bit to avoid overloading the server
|
||||||
|
usagePlan:
|
||||||
|
throttle:
|
||||||
|
burstLimit: 100
|
||||||
|
rateLimit: 50
|
||||||
|
|
||||||
############################################################################################
|
############################################################################################
|
||||||
#custom configuration settings
|
#custom configuration settings
|
||||||
############################################################################################
|
############################################################################################
|
||||||
@ -230,9 +236,11 @@ functions:
|
|||||||
|
|
||||||
events:
|
events:
|
||||||
- schedule:
|
- schedule:
|
||||||
rate: rate(10 minutes)
|
rate: rate(1440 minutes)
|
||||||
|
enabled: false
|
||||||
|
- schedule:
|
||||||
|
rate: rate(5 minutes)
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
topic: ${self:custom.snsTopic}
|
topic: ${self:custom.snsTopic}
|
||||||
tradeTable: ${self:custom.tradeTable}
|
tradeTable: ${self:custom.tradeTable}
|
||||||
|
Loading…
Reference in New Issue
Block a user