One-Minute EMA and Stochastic Scalping Strategy
Summary
This Freqtrade strategy seeks frequent small long trades on a one-minute chart. It calculates five-period EMAs of high, close, and low, a fast stochastic oscillator, and ADX. Entry requires the open below the low EMA, ADX above 30, both stochastic lines below 30, and the fast line crossing above the signal line. Exit signals occur when the open reaches or exceeds the high EMA or either stochastic line crosses above 70.
The configuration sets a 1% minimum ROI and a 4% stop loss, while its comments favor ROI-based exits and a large number of simultaneous trades to offset losses. These are stated recommendations, not evidence of profitability: the document provides no backtest, live results, market selection, or execution analysis. The approach may be sensitive to trading costs and rapid market changes, and the suggested trade count and settings require independent testing and risk assessment.
Key ideas
- The strategy looks for oversold stochastic conditions alongside an upward crossover to enter long.
- It requires ADX above 30 and the open below the five-period low EMA for entry.
- It exits when price reaches the high EMA or either stochastic line crosses above 70.
- The strategy uses a one-minute timeframe, a 1% ROI target, and a 4% stop loss.
- The document gives configuration guidance but no performance evidence.
Tags
Full text
# Scalp.py
```py
# --- Do not remove these libs ---
from freqtrade.strategy import IStrategy
from typing import Dict, List
from functools import reduce
from pandas import DataFrame
# --------------------------------
import talib.abstract as ta
import freqtrade.vendor.qtpylib.indicators as qtpylib
class Scalp(IStrategy):
"""
this strategy is based around the idea of generating a lot of potentatils buys and make tiny profits on each trade
we recommend to have at least 60 parallel trades at any time to cover non avoidable losses.
Recommended is to only sell based on ROI for this strategy
"""
INTERFACE_VERSION: int = 3
# Minimal ROI designed for the strategy.
# This attribute will be overridden if the config file contains "minimal_roi"
minimal_roi = {
"0": 0.01
}
# Optimal stoploss designed for the strategy
# This attribute will be overridden if the config file contains "stoploss"
# should not be below 3% loss
stoploss = -0.04
# Optimal timeframe for the strategy
# the shorter the better
timeframe = '1m'
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe['ema_high'] = ta.EMA(dataframe, timeperiod=5, price='high')
dataframe['ema_close'] = ta.EMA(dataframe, timeperiod=5, price='close')
dataframe['ema_low'] = ta.EMA(dataframe, timeperiod=5, price='low')
stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)
dataframe['fastd'] = stoch_fast['fastd']
dataframe['fastk'] = stoch_fast['fastk']
dataframe['adx'] = ta.ADX(dataframe)
# required for graphing
bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)
dataframe['bb_lowerband'] = bollinger['lower']
dataframe['bb_upperband'] = bollinger['upper']
dataframe['bb_middleband'] = bollinger['mid']
return dataframe
def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(dataframe['open'] < dataframe['ema_low']) &
(dataframe['adx'] > 30) &
(
(dataframe['fastk'] < 30) &
(dataframe['fastd'] < 30) &
(qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd']))
)
),
'enter_long'] = 1
return dataframe
def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(dataframe['open'] >= dataframe['ema_high'])
) |
(
(qtpylib.crossed_above(dataframe['fastk'], 70)) |
(qtpylib.crossed_above(dataframe['fastd'], 70))
),
'exit_long'] = 1
return dataframe
```Shown in full with attribution under the source's licence. Licence: GPL-3.0
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.