Merge pull request #1562 from freqtrade/test_strategy

Fix typo in test-strategy, add volume > 0 check to buy/sell check
This commit is contained in:
Misagh 2019-02-18 08:39:49 +01:00 committed by GitHub
commit cd48556c5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,7 @@ class TestStrategy(IStrategy):
# Experimental settings (configuration will overide these if set) # Experimental settings (configuration will overide these if set)
use_sell_signal = False use_sell_signal = False
use_profit_only = False sell_profit_only = False
ignore_roi_if_buy_signal = False ignore_roi_if_buy_signal = False
# Optional order type mapping # Optional order type mapping
@ -266,7 +266,8 @@ class TestStrategy(IStrategy):
( (
(dataframe['adx'] > 30) & (dataframe['adx'] > 30) &
(dataframe['tema'] <= dataframe['bb_middleband']) & (dataframe['tema'] <= dataframe['bb_middleband']) &
(dataframe['tema'] > dataframe['tema'].shift(1)) (dataframe['tema'] > dataframe['tema'].shift(1)) &
(dataframe['volume'] > 0) # Make sure Volume is not 0
), ),
'buy'] = 1 'buy'] = 1
@ -283,7 +284,8 @@ class TestStrategy(IStrategy):
( (
(dataframe['adx'] > 70) & (dataframe['adx'] > 70) &
(dataframe['tema'] > dataframe['bb_middleband']) & (dataframe['tema'] > dataframe['bb_middleband']) &
(dataframe['tema'] < dataframe['tema'].shift(1)) (dataframe['tema'] < dataframe['tema'].shift(1)) &
(dataframe['volume'] > 0) # Make sure Volume is not 0
), ),
'sell'] = 1 'sell'] = 1
return dataframe return dataframe