Strategy vault / Mean reversion
Multi Strategy Technical Analysis Trading System
This strategy is a multi-strategy technical analysis system comprising four independent sub-strategies: MACD strategy, EMA8 strategy, Simple MA strategy, and MA100 strategy. The system allows traders to flexibly…

This article introduces a trading strategy system that combines multiple technical indicators. The system integrates various technical analysis methods including MACD, EMA, Simple Moving Averages, and MA100, coupled with risk management and time filters, aimed at providing traders with a comprehensive trading solution.
Strategy Overview
This strategy is a multi-strategy technical analysis system comprising four independent sub-strategies: MACD strategy, EMA8 strategy, Simple MA strategy, and MA100 strategy. The system allows traders to flexibly choose different strategy types based on market conditions, with each sub-strategy having its unique entry and exit logic, supported by corresponding risk management mechanisms.
Strategy Principles
MACD Strategy: Captures market trends by identifying consecutive rising and falling patterns in the MACD histogram. Buy signals are triggered by three consecutive rising histogram bars, while sell signals are triggered by two consecutive falling bars.
EMA8 Strategy: Combines weekly EMA8, previous highs, and candlestick pattern analysis. The system enters long positions when price breaks above the weekly EMA8, closes above previous highs, and shows strong candlestick patterns. This strategy includes a 2% stop-loss setting.
Simple MA Strategy: Utilizes multiple exponential moving averages (10,15,25,35,40 periods) to build a trend-following system. Buy signals are triggered when shorter-period MAs are above longer-period MAs and price breaks above the shortest-period MA. A 2% stop-loss is implemented.
MA100 Strategy: Combines 100-day MA, 8-day MA, and 25-day MA, incorporating stochastic oscillator for oversold conditions. The system looks for buying opportunities in oversold areas when short-term MAs are above long-term MAs and price fluctuates near MA100. This strategy employs a 3% stop-loss setting.
Strategy Advantages
- Multi-strategy Integration: Enhances system adaptability and stability through the combination of different technical analysis methods.
- Comprehensive Risk Control: Each sub-strategy is equipped with stop-loss mechanisms, effectively controlling single-trade risk.
- High Flexibility: Traders can select the most suitable strategy type based on market conditions.
- Multi-dimensional Analysis: Incorporates market analysis across multiple dimensions including trend, momentum, and volatility.
- Visualization Support: The system provides complete chart visualization functionality for better market understanding.
Strategy Risks
- Parameter Optimization Risk: Multiple technical indicators' parameters require periodic optimization, risking overfitting.
- Market Environment Dependency: Different sub-strategies perform differently under various market conditions, requiring correct selection.
- Signal Lag: Technical indicators inherently have lag, potentially leading to suboptimal entry or exit timing.
- False Breakout Risk: May generate numerous false signals in ranging markets.
Optimization Directions
- Add Market Environment Recognition Module: Recommend adding market condition judgment functionality for automatic sub-strategy selection.
- Improve Profit-Taking Mechanism: Dynamically adjust profit-taking levels based on different market conditions.
- Incorporate Volatility Filtering: Suggest introducing ATR indicator for volatility analysis to filter trading signals in low-volatility environments.
- Optimize Parameter Adaptation: Develop dynamic parameter adjustment mechanisms to improve system adaptability.
- Add Volume Analysis: Recommend incorporating volume confirmation mechanisms to enhance signal reliability.
Summary
This multi-strategy technical analysis trading system provides traders with a comprehensive trading decision framework by integrating multiple mature technical analysis methods. The system's main advantages lie in its flexibility and risk control capabilities, though it requires traders to have a deep understanding of markets for correct implementation. Through continuous optimization and improvement, this system has the potential to become an increasingly refined trading tool.
Source Pine Script
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-09 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ v5 code implements multiple trading strategies
//@version=5
strategy("Multi-Strategy Trading System", overlay=true)
// Input parameters for customization
strategy_type = input.string("MACD", "Strategy Type", options=["MACD", "EMA8", "SimpleMA", "MA100"])
show_macd = input.bool(true, "Show MACD Signals")
show_ema = input.bool(true, "Show EMA Signals")
show_ma = input.bool(true, "Show MA Signals")
// MACD Strategy Components
[macdLine, signalLine, histLine] = ta.macd(close, 12, 26, 9)
// Function to detect three consecutive ascending histogram bars
isThreeAscendingBars(hist) =>
not na(hist[3]) and hist[3] < hist[2] and hist[2] < hist[1] and hist[1] < hist[0]
// Function to detect two consecutive descending histogram bars
isTwoDescendingBars(hist) =>
not na(hist[2]) and hist[2] > hist[1] and hist[1] > hist[0]
// EMA Strategy Components
ema8_weekly = request.security(syminfo.tickerid, "W", ta.ema(close, 8))
weeklyHigh = request.security(syminfo.tickerid, "W", high)
previousWeekHigh = weeklyHigh[1]
isStrongCandleWeekly = request.security(syminfo.tickerid, "W", close > open and (close - open) > (high - low) * 0.6)
// Simple MA Strategy Components
ema10 = ta.ema(close, 10)
ema15 = ta.ema(close, 15)
ema25 = ta.ema(close, 25)
ema35 = ta.ema(close, 35)
ema40 = ta.ema(close, 40)
// MA100 Strategy Components
ma100 = ta.sma(close, 100)
ma8 = ta.sma(close, 8)
ma25 = ta.sma(close, 25)
// Corrected Stochastic Oscillator Calculation
stochK = ta.stoch(high, low, close, 14)
stochD = ta.sma(stochK, 3)
isOversold = stochK < 20 and stochD < 20
// MACD Strategy Logic
if strategy_type == "MACD"
// Buy condition: Three ascending histogram bars after lowest
if isThreeAscendingBars(histLine)
strategy.entry("MACD Buy", strategy.long)
// Sell condition: Two descending histogram bars after highest
if isTwoDescendingBars(histLine)
strategy.close("MACD Buy")
// EMA8 Strategy Logic
if strategy_type == "EMA8"
if close > ema8_weekly and close > previousWeekHigh and isStrongCandleWeekly
strategy.entry("EMA8 Buy", strategy.long)
strategy.exit("EMA8 Exit", "EMA8 Buy", stop=low - (low * 0.02))
// Simple MA Strategy Logic
if strategy_type == "SimpleMA"
isUptrend = ema10 > ema15 and ema15 > ema25 and ema25 > ema35 and ema35 > ema40
if isUptrend and close > ema10 and close[1] <= ema10[1]
strategy.entry("MA Buy", strategy.long)
strategy.exit("MA Exit", "MA Buy", stop=low - (low * 0.02))
// MA100 Strategy Logic
if strategy_type == "MA100"
isUptrend = ma8 > ma100 and ma25 > ma100
isPriceNearMA100 = math.abs(close - ma100) / ma100 * 100 < 1
if isUptrend and isPriceNearMA100 and isOversold
strategy.entry("MA100 Buy", strategy.long)
strategy.exit("MA100 Exit", "MA100 Buy", stop=low - (low * 0.03))
// Plotting components for visualization
plot(ma100, "MA100", color=color.blue, linewidth=2)
plot(ema8_weekly, "EMA8 Weekly", color=color.yellow, linewidth=2)
plot(series=histLine, title="MACD Histogram", style=plot.style_histogram, color=histLine > 0 ? color.green : color.red)
Published by ChaoZhang on the FMZ strategy square · last modified 2024-12-11. 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-Strategy-Technical-Analysis-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
- Advanced 15 Minute Chart Trading Signal StrategyPine Script · Mean reversion · 3h
- Dynamic Adaptive Multi Timeframe Trend Following and Range Reversal Hybrid StrategyPine Script · Mean reversion · 2d
- Dual Confirmation Quant Trading StrategyPine Script · Mean reversion · 15m
- Dual Indicator Slight Reversal Trading StrategyPine Script · Mean reversion · 15m
- Market Cypher Wave B Automated Trading StrategyPine Script · Mean reversion · 1h
- Multi Indicator Trend Reversal Trading StrategyPine Script · Mean reversion · 1h