mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-02-21 11:51:05 +00:00
initial test
This commit is contained in:
43
tests/strategy/strats/strategy_test_v3_recursive_issue.py
Normal file
43
tests/strategy/strats/strategy_test_v3_recursive_issue.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement
|
||||
from pandas import DataFrame
|
||||
from technical.indicators import ichimoku
|
||||
|
||||
from freqtrade.strategy import IStrategy
|
||||
from freqtrade.strategy.parameters import CategoricalParameter
|
||||
|
||||
import talib.abstract as ta
|
||||
|
||||
class strategy_test_v3_recursive_issue(IStrategy):
|
||||
INTERFACE_VERSION = 3
|
||||
|
||||
# Minimal ROI designed for the strategy
|
||||
minimal_roi = {
|
||||
"0": 0.04
|
||||
}
|
||||
|
||||
# Optimal stoploss designed for the strategy
|
||||
stoploss = -0.10
|
||||
|
||||
# Optimal timeframe for the strategy
|
||||
timeframe = '5m'
|
||||
scenario = CategoricalParameter(['no_bias', 'bias1'], default='bias1', space="buy")
|
||||
|
||||
# Number of candles the strategy requires before producing valid signals
|
||||
startup_candle_count: int = 100
|
||||
|
||||
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||
# bias is introduced here
|
||||
if self.scenario.value == 'no_bias':
|
||||
dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)
|
||||
else:
|
||||
dataframe['rsi'] = ta.RSI(dataframe, timeperiod=50)
|
||||
|
||||
return dataframe
|
||||
|
||||
def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||
|
||||
return dataframe
|
||||
|
||||
def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
|
||||
|
||||
return dataframe
|
||||
Reference in New Issue
Block a user