Timeframe
1h
Direction
Long Only
Stoploss
-90.0%
Trailing Stop
No
ROI
0m: 204.0%, 20m: 202.0%, 30m: 201.0%, 40m: 200.0%
Interface Version
N/A
Startup Candles
N/A
Indicators
1
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
freqtrade/freqtrade-strategies
Strategy 003 author@: Gerald Lonlas github@: https://github.com/freqtrade/freqtrade-strategies
# Freqtrade_backtest_validation_freqtrade1.py
# This script is 1 of a pair the other being freqtrade_backtest_validation_tradingview1
# These should be executed on their respective platforms for the same coin/period/resolution
# The purpose is to test Freqtrade backtest provides like results to a known industry platform.
#
# --- Do not remove these libs ---
from freqtrade.strategy import IStrategy
from pandas import DataFrame
# --------------------------------
# Add your lib to import here
import talib.abstract as ta
class Freqtrade_backtest_validation_freqtrade1(IStrategy):
INTERFACE_VERSION: int = 3
# Minimal ROI designed for the strategy.
minimal_roi = {
"40": 2.0,
"30": 2.01,
"20": 2.02,
"0": 2.04
}
stoploss = -0.90
timeframe = '1h'
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
# SMA - Simple Moving Average
dataframe['fastMA'] = ta.SMA(dataframe, timeperiod=14)
dataframe['slowMA'] = ta.SMA(dataframe, timeperiod=28)
return dataframe
def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(dataframe['fastMA'] > dataframe['slowMA'])
),
'enter_long'] = 1
return dataframe
def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(dataframe['fastMA'] < dataframe['slowMA'])
),
'exit_long'] = 1
return dataframe