0bps

Strategy vault / Breakout

Momentum Moving Average Breakout Strategy

This strategy combines momentum indicators with moving average breakouts, entering trades when momentum aligns in a direction and price breaks the MA. The trading logic is: 1. Compute short-term momentum, such as…

Author
ChaoZhang
Complexity
Starter · 20 lines
Parameters
0
Backtest bar
30m · intraday
Tested on
BTC/USDT · futures

Strategy Logic

This strategy combines momentum indicators with moving average breakouts, entering trades when momentum aligns in a direction and price breaks the MA.

The trading logic is:

  1. Compute short-term momentum, such as 5-day momentum

  2. A long signal triggers when current and prior 2 momentum bars are above 50

  3. Go long when price breaks above 5-day MA

  4. A short signal triggers when current and prior 2 momentum bars are below 50

  5. Go short when price breaks below 5-day MA

  6. Use fixed profit target and trailing stop loss

The strategy capitalizes on momentum strength for trend identification, combining it with MA breakouts for high-probability signals to capture short-term price swings.

Advantages

  • Momentum directionality strongly defines trend

  • MA breakout improves signal quality

  • Profit target and stop loss combined

Risks

  • Consecutive momentum can lag

  • Requires iterative parameter optimization

  • Profit targets and stops need prudence

Summary

This strategy synergizes momentum and MA breakout systems with prudent profit taking and risk controls. But parameter tuning and stop loss optimization are crucial for real-world effectiveness.

Source Pine Script

/*backtest
start: 2023-09-06 00:00:00
end: 2023-09-13 00:00:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
// strategy("BTC MOM EMA V1", overlay=true)

longCondition = ta.mom(close,5) > 50 and ta.mom(close[1],5) > 50 and ta.mom(close[2],5) > 50 and close > ta.ema(close,5)
if (longCondition)
    strategy.entry("My Long Entry Id", strategy.long)
    strategy.exit("My Long Entry Id", profit=1000,trail_points=60)

shortCondition = ta.mom(close,5) < 50 and ta.mom(close[1],5) < 50 and ta.mom(close[2],5) < 50 and close < ta.ema(close,5)
if (shortCondition)
    strategy.entry("My Short Entry Id", strategy.short)
    strategy.exit("My Short Entry Id", profit=1000,trail_points=60)

Published by ChaoZhang on the FMZ strategy square · last modified 2023-09-14. 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.

in Claude Code, Cursor, Codex & 4 more
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Momentum-Moving-Average-Breakout-Strategy.md
  1. npx agenkit install engineering-kit in your project
  2. Paste the command into your agent and approve each phase
  3. 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

esc

Try , , or .

↑↓ move↵ open