fix rebase problem

This commit is contained in:
Matthias 2018-07-19 19:41:42 +02:00
parent 760c79c5e9
commit 4fb9823cfb
4 changed files with 7 additions and 9 deletions

View File

@ -393,8 +393,8 @@ class FreqtradeBot(object):
open_date=datetime.utcnow(), open_date=datetime.utcnow(),
exchange=self.exchange.id, exchange=self.exchange.id,
open_order_id=order_id, open_order_id=order_id,
strategy=self.analyze.get_strategy_name(), strategy=self.strategy.get_strategy_name(),
ticker_interval=constants.TICKER_INTERVAL_MINUTES[self.analyze.get_ticker_interval()] ticker_interval=constants.TICKER_INTERVAL_MINUTES[self.config['ticker_interval']]
) )
Trade.session.add(trade) Trade.session.add(trade)
Trade.session.flush() Trade.session.flush()

View File

@ -164,7 +164,7 @@ class Backtesting(object):
buy_signal = sell_row.buy buy_signal = sell_row.buy
sell = self.strategy.should_sell(trade, sell_row.open, sell_row.date, buy_signal, sell = self.strategy.should_sell(trade, sell_row.open, sell_row.date, buy_signal,
sell_row.sell) sell_row.sell)
if sell.sell_flag: if sell.sell_flag:
return BacktestResult(pair=pair, return BacktestResult(pair=pair,

View File

@ -88,13 +88,12 @@ class IStrategy(ABC):
:param dataframe: DataFrame :param dataframe: DataFrame
:return: DataFrame with sell column :return: DataFrame with sell column
""" """
return self.strategy.populate_sell_trend(dataframe=dataframe)
def get_strategy_name(self) -> str: def get_strategy_name(self) -> str:
""" """
Returns strategy class name Returns strategy class name
""" """
return self.strategy.__class__.__name__ return self.__class__.__name__
def analyze_ticker(self, ticker_history: List[Dict]) -> DataFrame: def analyze_ticker(self, ticker_history: List[Dict]) -> DataFrame:
""" """

View File

@ -16,11 +16,11 @@ import requests
from freqtrade import (DependencyException, OperationalException, from freqtrade import (DependencyException, OperationalException,
TemporaryError, constants) TemporaryError, constants)
from freqtrade.strategy.interface.IStrategy import SellType, SellCheckTuple
from freqtrade.freqtradebot import FreqtradeBot from freqtrade.freqtradebot import FreqtradeBot
from freqtrade.persistence import Trade from freqtrade.persistence import Trade
from freqtrade.rpc import RPCMessageType from freqtrade.rpc import RPCMessageType
from freqtrade.state import State from freqtrade.state import State
from freqtrade.strategy.interface import SellType, SellCheckTuple
from freqtrade.tests.conftest import log_has, patch_coinmarketcap, patch_exchange from freqtrade.tests.conftest import log_has, patch_coinmarketcap, patch_exchange
@ -1625,8 +1625,6 @@ def test_sell_profit_only_enable_loss(default_conf, limit_buy_order, fee, market
""" """
patch_RPCManager(mocker) patch_RPCManager(mocker)
patch_coinmarketcap(mocker) patch_coinmarketcap(mocker)
mocker.patch('freqtrade.freqtradebot.strategy.interface.stop_loss_reached',
return_value=SellCheckTuple(sell_flag=False, sell_type=SellType.NONE))
mocker.patch.multiple( mocker.patch.multiple(
'freqtrade.exchange.Exchange', 'freqtrade.exchange.Exchange',
validate_pairs=MagicMock(), validate_pairs=MagicMock(),
@ -1647,7 +1645,8 @@ def test_sell_profit_only_enable_loss(default_conf, limit_buy_order, fee, market
freqtrade = FreqtradeBot(conf) freqtrade = FreqtradeBot(conf)
patch_get_signal(freqtrade) patch_get_signal(freqtrade)
freqtrade.strategy.stop_loss_reached = \ freqtrade.strategy.stop_loss_reached = \
lambda current_rate, trade, current_time, current_profit: False lambda current_rate, trade, current_time, current_profit: SellCheckTuple(
sell_flag=False, sell_type=SellType.NONE)
freqtrade.create_trade() freqtrade.create_trade()
trade = Trade.query.first() trade = Trade.query.first()