Adaptive Moving Average Crossover System with Momentum Breakout
The core of this strategy is to implement breakout trading using adaptive moving averages and momentum indicators. Firstly, the strategy constructs adaptive moving averages with Heiken Ashi weighted average price and…

I. Overview
The core of this strategy is to implement breakout trading using adaptive moving averages and momentum indicators. Firstly, the strategy constructs adaptive moving averages with Heiken Ashi weighted average price and triple exponential smoothing; then, combined with momentum indicators, it judges breakout signals and makes trading decisions.
II. Strategy Principle
The strategy consists of three main parts:
Construction of adaptive moving averages. The strategy builds three adaptive moving averages using Heiken Ashi price and triple exponential smoothing. These moving averages can respond quickly to price changes.
Calculation of momentum indicators. The strategy uses the difference between triple exponential smoothing of prices as the momentum indicator. This indicator can highlight changes in price trends.
Moving average crossover as trading signals. When the fast moving average crosses over the slow one, a buy signal is generated. When the fast crosses below the slow one, a sell signal is generated.
III. Advantages of the Strategy
By combining adaptive moving averages and momentum indicators, this strategy can quickly capture trend changes in prices and generate trading signals. The main advantages are:
- Heiken Ashi prices to construct adaptive moving averages can respond faster to price changes.
- Triple exponential smoothing can effectively smooth price data and handle outliers.
- Momentum indicators can clearly identify trend change points in prices.
- Moving average crossovers generate clear trading signals.
- Flexible parameter settings for adjustability.
IV. Risks and Mitigations
- Crossover signals may be misleading when prices fluctuate violently. Adjust parameters to filter signals when necessary.
- The strategy works better in bull markets. Use stop loss to protect capital in bear markets.
V. Optimization Directions
- Test more types of moving averages to find better parameters.
- Add additional filters to avoid false signals, e.g. volume filter.
- Optimize parameter settings for adaptability to different markets.
VI. Conclusion
This strategy integrates adaptive moving averages and momentum indicators to generate efficient trading signals by quickly responding to price changes. Through parameter tuning, it can be adaptive to different market environments. This is a very practical breakout trading strategy.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 55 | EMA LENGTH? |
Source Pine Script
/*backtest
start: 2024-01-20 00:00:00
end: 2024-02-19 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("YASIN Crossover Strategy", overlay=true)
EMAlength = input(55, 'EMA LENGTH?')
src = ohlc4
var float haOpen = na
haOpen := na(haOpen[1]) ? src : (src + haOpen[1]) / 2
haC = (ohlc4 + haOpen + ta.highest(high, 1) + ta.lowest(low, 1)) / 4
EMA1 = ta.ema(haC, EMAlength)
EMA2 = ta.ema(EMA1, EMAlength)
EMA3 = ta.ema(EMA2, EMAlength)
TMA1 = 3 * EMA1 - 3 * EMA2 + EMA3
EMA4 = ta.ema(TMA1, EMAlength)
EMA5 = ta.ema(EMA4, EMAlength)
EMA6 = ta.ema(EMA5, EMAlength)
TMA2 = 3 * EMA4 - 3 * EMA5 + EMA6
IPEK = TMA1 - TMA2
YASIN = TMA1 + IPEK
EMA7 = ta.ema(hlc3, EMAlength)
EMA8 = ta.ema(EMA7, EMAlength)
EMA9 = ta.ema(EMA8, EMAlength)
TMA3 = 3 * EMA7 - 3 * EMA8 + EMA9
EMA10 = ta.ema(TMA3, EMAlength)
EMA11 = ta.ema(EMA10, EMAlength)
EMA12 = ta.ema(EMA11, EMAlength)
TMA4 = 3 * EMA10 - 3 * EMA11 + EMA12
IPEK1 = TMA3 - TMA4
YASIN1 = TMA3 + IPEK1
t1 = time(timeframe.period, "0020-0030")
// بررسی شرایط سیگنال خرید و فروش
buyCondition = YASIN1 > YASIN and YASIN1[1] <= YASIN[1]
sellCondition = YASIN1 < YASIN and YASIN1[1] >= YASIN[1]
// اعمال سیگنال خرید و فروش
strategy.entry("Buy", strategy.long, when = buyCondition)
strategy.entry("Sell", strategy.short, when = sellCondition)Published by ChaoZhang on the FMZ strategy square · last modified 2024-02-20. 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/Adaptive-Moving-Average-Crossover-System-with-Momentum-Breakout.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
- EMA and Heikin Ashi Trading StrategyPine Script · Breakout · 1h
- Adaptive Multi Period Trading Strategy Based on Wave Trend Momentum BreakoutPine Script · Breakout · 2h
- Dynamic ATR based Trailing Stop Trading StrategyPine Script · Breakout · 1d
- Dynamic Bollinger Bands Breakout Quantitative Trading StrategyPine Script · Breakout · 2d
- Dynamic Dual Moving Average Breakthrough Trading System Dynamic Dual Moving Average Breakthrough Trading SystemPine Script · Breakout · 1d
- Flexible Long Short Trading Strategy Based on Keltner ChannelsPine Script · Breakout · 1d