From eacb6b5a035a5a2ff52ae2b0a4a197fb16d46f93 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste LE STANG Date: Tue, 30 Jan 2018 20:54:35 +0100 Subject: [PATCH] Adding buy/sell notification towards the strategy --- freqtrade/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/freqtrade/main.py b/freqtrade/main.py index 6f7a67df2..7e78a3864 100755 --- a/freqtrade/main.py +++ b/freqtrade/main.py @@ -231,6 +231,9 @@ def execute_sell(trade: Trade, limit: float) -> None: order_id = exchange.sell(str(trade.pair), limit, trade.amount) trade.open_order_id = order_id + strategy = Strategy() + strategy.did_sold(trade.pair) + fmt_exp_profit = round(trade.calc_profit_percent(rate=limit) * 100, 2) profit_trade = trade.calc_profit(rate=limit) current_rate = exchange.get_ticker(trade.pair, False)['bid'] @@ -409,6 +412,8 @@ def create_trade(stake_amount: float, interval: int) -> bool: _CONF['stake_currency'], _CONF['fiat_display_currency'] ) + strategy = Strategy() + strategy.did_bought(pair) # Create trade entity and return rpc.send_msg('*{}:* Buying [{}]({}) with limit `{:.8f} ({:.6f} {}, {:.3f} {})` '.format(