Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
foolcage committed Jul 9, 2018
1 parent 64268c7 commit db315bf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions fooltrader/bot/strategy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
class Strategy(object):
# open_long_condition
# close_long_condition
# open_short_condition
# close_short_condition
pass
2 changes: 1 addition & 1 deletion fooltrader/botsamples/notify_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def handle_trigger(self, trigger_flag, sub_id, subscription, current_price, chan
if 'weixin' in subscription['actions']:
self.weixin_action.send_message(subscription['userId'], title="价格条件触发", body=None,
name=self.security_item['name'], price=current_price,
change_pct=change_pct)
change_pct='{:.2%}'.format(change_pct))

if triggered:
self.has_triggered[trigger_flag] = sub_triggerd.to_dict()
Expand Down
4 changes: 2 additions & 2 deletions fooltrader/domain/subscription_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class PriceSubscription(BaseDocType):
"code": "BTC-USDT",
"upPct": 1,
"downPct": 2,
"up": 7000,
"down": 6000,
"upTo": 7000,
"downTo": 6000,
"actions": ["weixin", "email", "shortMsg"],
"repeat": False
}
Expand Down
4 changes: 2 additions & 2 deletions fooltrader/domain/subscription_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class PriceSubscriptionSchema(Schema):
"code": "BTC-USDT",
"upPct": 1,
"downPct": 2,
"up": 7000,
"down": 6000,
"upTo": 7000,
"downTo": 6000,
"actions": ["weixin", "email", "shortMsg"],
"repeat": False
}
Expand Down
2 changes: 1 addition & 1 deletion fooltrader/rest/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from fooltrader.rest import app

if __name__ == '__main__':
app.run()
app.run(host='0.0.0.0')

0 comments on commit db315bf

Please sign in to comment.