extract get_history_data from get_signal

This commit is contained in:
Matthias
2018-07-26 18:22:23 +01:00
parent 6e437a7290
commit 484103b957
2 changed files with 9 additions and 5 deletions

View File

@@ -327,13 +327,18 @@ class FreqtradeBot(object):
if not whitelist:
raise DependencyException('No currency pairs in whitelist')
th = {}
for _pair in whitelist:
th[_pair] = self.exchange.get_ticker_history(_pair, interval)
# Pick pair based on buy signals
bought_at_least_one = False
for _pair in whitelist:
(buy, sell) = self.strategy.get_signal(self.exchange, _pair, interval)
(buy, sell) = self.strategy.get_signal(_pair, interval, th[_pair])
if buy and not sell:
return self.execute_buy(_pair, stake_amount)
return False
bought_at_least_one |= self.execute_buy(_pair, stake_amount)
return bought_at_least_one
def execute_buy(self, pair: str, stake_amount: float) -> bool:
"""