Update StackingDemo.py
This commit is contained in:
		| @@ -73,8 +73,8 @@ class StackingDemo(IStrategy): | |||||||
|     # Minimal ROI designed for the strategy. |     # Minimal ROI designed for the strategy. | ||||||
|     # This attribute will be overridden if the config file contains "minimal_roi". |     # This attribute will be overridden if the config file contains "minimal_roi". | ||||||
|     minimal_roi = { |     minimal_roi = { | ||||||
| #        "60": 0.01, |         "60": 0.01, | ||||||
| #        "30": 0.02, |         "30": 0.02, | ||||||
|         "0": 0.001 |         "0": 0.001 | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -403,10 +403,9 @@ class StackingDemo(IStrategy): | |||||||
|         dataframe.loc[ |         dataframe.loc[ | ||||||
|             ( |             ( | ||||||
|                 ( |                 ( | ||||||
| #                    (qtpylib.crossed_above(dataframe['rsi'], 30)) &  # Signal: RSI crosses above 30 |                     (qtpylib.crossed_above(dataframe['rsi'], 30)) &  # Signal: RSI crosses above 30 | ||||||
| #                    (dataframe['tema'] <= dataframe['bb_middleband']) &  # Guard: tema below BB middle |                     (dataframe['tema'] <= dataframe['bb_middleband']) &  # Guard: tema below BB middle | ||||||
| #                    (dataframe['tema'] > dataframe['tema'].shift(1)) |  # Guard: tema is raising |                     (dataframe['tema'] > dataframe['tema'].shift(1)) |  # Guard: tema is raising | ||||||
|                     (dataframe['close'] < dataframe['close'].shift(1)) | |  | ||||||
|                     # use either buy signal or rebuy flag to trigger a buy |                     # use either buy signal or rebuy flag to trigger a buy | ||||||
|                     (self.custom_info[metadata["pair"]]["rebuy"] == 1) |                     (self.custom_info[metadata["pair"]]["rebuy"] == 1) | ||||||
|                 ) & |                 ) & | ||||||
| @@ -426,11 +425,10 @@ class StackingDemo(IStrategy): | |||||||
|         dataframe.loc[ |         dataframe.loc[ | ||||||
|             ( |             ( | ||||||
|                 ( |                 ( | ||||||
| #                    (qtpylib.crossed_above(dataframe['rsi'], 70)) &  # Signal: RSI crosses above 70 |                     (qtpylib.crossed_above(dataframe['rsi'], 70)) &  # Signal: RSI crosses above 70 | ||||||
| #                    (dataframe['tema'] > dataframe['bb_middleband']) &  # Guard: tema above BB middle |                     (dataframe['tema'] > dataframe['bb_middleband']) &  # Guard: tema above BB middle | ||||||
| #                    (dataframe['tema'] < dataframe['tema'].shift(1)) |  # Guard: tema is falling |                     (dataframe['tema'] < dataframe['tema'].shift(1)) |  # Guard: tema is falling | ||||||
|                     # use either sell signal or resell flag to trigger a sell |                     # use either sell signal or resell flag to trigger a sell | ||||||
|                     (dataframe['close'] > dataframe['close'].shift(1)) | |  | ||||||
|                     (self.custom_info[metadata["pair"]]["resell"] == 1) |                     (self.custom_info[metadata["pair"]]["resell"] == 1) | ||||||
|                 ) & |                 ) & | ||||||
|                 (dataframe['volume'] > 0)  # Make sure Volume is not 0 |                 (dataframe['volume'] > 0)  # Make sure Volume is not 0 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user