Strategy vault / Trend following
Multi Period EMA Trend Following with Support Resistance Hybrid Trading System
This strategy is a hybrid trading system that combines multiple technical analysis indicators. It primarily uses the Exponential Moving Average (EMA) system to determine market trends, while incorporating Support and…

Overview
This strategy is a hybrid trading system that combines multiple technical analysis indicators. It primarily uses the Exponential Moving Average (EMA) system to determine market trends, while incorporating Support and Resistance (SR) levels for entry signals and Average True Range (ATR) for risk control. The strategy employs dynamic stop-loss settings that can adaptively adjust based on market volatility.
Strategy Principles
The strategy operates based on the following core components:
- Trend Determination System - Uses the spatial relationship and difference between 20-period and 50-period EMAs to judge trend strength
- Breakthrough Signal System - Constructs support and resistance levels using 9-period high and low prices
- Risk Control System - Uses 14-period ATR to dynamically adjust stop-loss distances
- Entry logic includes two conditions:
- Price breaks through support/resistance levels
- In trend and price is in the correct EMA direction
- Exit logic based on ATR dynamic stop-loss, with stop distance set at 10 times ATR
Strategy Advantages
- Multi-dimensional Confirmation - Combines trend following and breakout trading for improved signal reliability
- Strong Adaptability - Dynamically adjusts stops through ATR, adapting to different market environments
- Comprehensive Risk Control - Has clear stop-loss mechanisms that adjust with market volatility
- High Systematization - Clear trading rules, unaffected by subjective judgment
- Good Scalability - Stable core framework, easy to add new trading rules
Strategy Risks
- Oscillation Market Risk - May generate frequent false signals in sideways markets
- Slippage Risk - Breakout trades may face significant slippage during high volatility
- Stop-Loss Range Risk - Large ATR multiplier settings may lead to significant drawdowns
- Signal Delay Risk - Moving average system has inherent lag
- Parameter Sensitivity - Multiple parameters require thorough testing and optimization
Strategy Optimization Directions
Signal Filtering Optimization
- Add volume confirmation mechanism
- Introduce volatility filters
- Integrate more technical indicators for verification
Position Management Optimization
- Implement dynamic position management
- Adjust position size based on volatility
- Add staged position building mechanism
Stop-Loss Optimization
- Introduce trailing stops
- Optimize ATR multiplier settings
- Add profit protection mechanism
Summary
This strategy constructs a complete trading system by combining multiple mature technical analysis methods. Its core advantages lie in system adaptability and risk control capabilities. Through continuous optimization and improvement, the strategy shows promise in maintaining stable performance across different market environments. Traders are advised to conduct thorough historical data testing and parameter optimization before live trading.
Source Pine Script
/*backtest
start: 2024-02-18 00:00:00
end: 2025-02-16 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("Multi-Strategy Trader v1 by SUNNY GUHA +91 9836021040 / www.oiesu.com", overlay=true)
// Basic Inputs
supResLookback = input.int(9, "Support/Resistance Lookback")
atrPeriod = input.int(14, "ATR Period")
stopMultiplier = input.float(10.0, "Stop Loss ATR Multiplier")
// Technical Indicators
atr = ta.atr(atrPeriod)
highestHigh = ta.highest(high, supResLookback)
lowestLow = ta.lowest(low, supResLookback)
ema20 = ta.ema(close, 20)
ema50 = ta.ema(close, 50)
// Basic Strategy Rules
isTrending = math.abs(ema20 - ema50) > atr
longSignal = close > highestHigh[1] or (isTrending and ema20 > ema50 and close > ema20)
shortSignal = close < lowestLow[1] or (isTrending and ema20 < ema50 and close < ema20)
// Entry Logic
if longSignal and strategy.position_size <= 0
strategy.entry("Long", strategy.long)
if shortSignal and strategy.position_size >= 0
strategy.entry("Short", strategy.short)
// Stop Loss Logic
longStopPrice = close - (atr * stopMultiplier)
shortStopPrice = close + (atr * stopMultiplier)
// Exit Logic
if strategy.position_size > 0
strategy.exit("Long Exit", "Long", stop=longStopPrice)
if strategy.position_size < 0
strategy.exit("Short Exit", "Short", stop=shortStopPrice)
// Basic Plotting
plot(ema20, "EMA 20", color.blue)
plot(ema50, "EMA 50", color.red)
Published by ChaoZhang on the FMZ strategy square · last modified 2025-02-18. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Multi-Period-EMA-Trend-Following-with-Support-Resistance-Hybrid-Trading-System.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Fixed Range Volume Profile And Anchored VWAP Trend Identification Strategy With Dynamic Stop LossPine Script · Trend following · 1h
- Multi Factor Trend Price Action Strategy with Dynamic Risk Management SystemPine Script · Trend following · 2h
- Adaptive Trend Following Strategy Combining Dual Moving Average Crossover and RSIPine Script · Trend following · 2d
- Advanced Multi Indicator Trend Confirmation Trading StrategyPine Script · Trend following · 1d
- MACD EMA Multi Period Dynamic Crossover Quantitative Trading SystemPine Script · Trend following · 1h
- Multi Indicator Trend Following Strategy with Dynamic Channel and Moving Average Trading SystemPine Script · Trend following · 1d