Timeframe
1h
Direction
Long Only
Stoploss
-99.0%
Trailing Stop
No
ROI
0m: 10000.0%
Interface Version
3
Startup Candles
N/A
Indicators
1
freqtrade/freqtrade-strategies
freqtrade/freqtrade-strategies
this is an example class, implementing a PSAR based trailing stop loss you are supposed to take the `custom_stoploss()` and `populate_indicators()` parts and adapt it to your own strategy
freqtrade/freqtrade-strategies
Strategy 003 author@: Gerald Lonlas github@: https://github.com/freqtrade/freqtrade-strategies
"""
AutoResearch — the single file the agent iterates on.
Baseline: plain RSI mean-reversion.
- Enter long when RSI(14) < 30
- Exit long when RSI(14) > 70
- Hard stoploss at -10%, ROI table exits at any profit above 1%
The agent is free to change ANYTHING in this file — indicators, logic, attributes,
imports — as long as the class still exposes an IStrategy-compatible surface that
FreqTrade's Backtesting can load and run.
"""
from pandas import DataFrame
import talib.abstract as ta
from freqtrade.strategy import IStrategy
class AutoResearch(IStrategy):
INTERFACE_VERSION = 3
timeframe = "1h"
can_short = False
minimal_roi = {"0": 100}
stoploss = -0.99
trailing_stop = False
process_only_new_candles = True
use_exit_signal = True
exit_profit_only = True
ignore_roi_if_entry_signal = False
startup_candle_count: int = 30
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe["rsi"] = ta.RSI(dataframe, timeperiod=14)
return dataframe
def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[dataframe["rsi"] < 21, "enter_long"] = 1
return dataframe
def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[dataframe["rsi"] > 62, "exit_long"] = 1
return dataframe