EMA 40 Pullback Pyramid Strategy by ADXAE
By ADXAE
Performance Metrics
- Author: ADXAE
- Symbol: NASDAQ:HIVE
- Timeframe: 1 day
- Win Rate: 25.5%
- Profit Factor: 1.314
Description
EMA 40 Pullback Pyramid StrategyEMA 40 Pullback Pyramid Strategy is an educational trend-following strategy designed to study long-side entries around a rising 40-period Exponential Moving Average, with optional pullback re-entry logic, ADX trend-strength filtering, and EMA cross-based entry/exit conditions.This is a strategy script, not a prediction tool and not financial advice. It is intended for research, backtesting, and forward-testing only. Historical results are hypothetical and can differ significantly from live trading due to slippage, commissions, liquidity, order execution, symbol behavior, timeframe selection, and market regime changes.What the strategy doesThe strategy uses the 40-period EMA as its main directional reference.The EMA color changes according to its slope:- Green EMA: the EMA is rising.- Red EMA: the EMA is falling.- Gray EMA: the EMA is flat or unchanged.The strategy can enter long positions when selected bullish conditions occur and can close positions when selected bearish or exit conditions occur.Core logic1. EMA 40 trend directionThe strategy calculates a fast EMA using the selected EMA length. The default value is 40.A bullish trend condition exists when the EMA is rising. A bearish condition exists when the EMA is falling.The original base entry occurs when the EMA changes from not rising to rising, and ADX is above the selected minimum threshold.2. ADX trend-strength filterThe strategy uses DMI / ADX to filter weak trend conditions.A trade can qualify only when ADX is above the selected ADX threshold. The default threshold is 20.This filter is intended to reduce entries during weak or sideways market conditions, but it does not eliminate false signals.3. Pullback re-entry logicWhen enabled, the pullback module looks for price to retrace toward the EMA by a selected ATR-based distance and then recover above the EMA.The pullback condition uses:- ATR length.- Pullback distance multiplied by ATR.- Recovery candle logic, where the candle closes above the EMA and closes above its open.This feature is designed to study additional entries during an existing upward EMA trend. Because pyramiding is enabled, these pullback signals can add to an existing long position depending on the strategy settings.4. EMA 40 cross signalsThe strategy includes optional EMA cross buy/sell logic.The cross detection mode can be:- Close mode: uses close crossing above or below the EMA.- Wick mode: uses wick interaction with the EMA followed by a close on the opposite side.When “Use EMA cross signals in strategy orders” is enabled, these signals can participate in actual strategy entries and exits. When disabled, they can be used only as visual reference signals.5. Minimum bars between entriesThe strategy includes a minimum-bars-between-entries setting. This helps reduce immediate repeated entries and gives users control over signal spacing.6. PyramidingThe strategy uses pyramiding to allow multiple long entries when qualifying conditions appear. This is mainly intended to study whether adding into a trend after pullbacks improves or worsens the tested behavior.Users should review this setting carefully. Pyramiding increases exposure and can materially increase both potential returns and potential drawdowns.Default strategy propertiesThe script uses the following default strategy properties:- Initial capital: 1,000- Position sizing: percent of equity- Default order size: 33% of equity- Pyramiding: 3- Commission: 0.1%- Slippage: defined in the strategy settings- Bar magnifier: disabled- Calculate on every tick: disabled- Process orders on close: disabledThese settings are included for testing purposes only. They may not be suitable for every market, timeframe, or trader. Users should adjust position sizing, commission, slippage, pyramiding, and test date range to reflect realistic conditions for the instrument being tested.Important backtesting noteTradingView strategy results are simulations based on historical bar data. They are not live trading results.Backtest results can change significantly depending on:- Symbol- Timeframe- Date range- Commission- Slippage- Liquidity- Spread- EMA length- ADX threshold- ATR length- Pullback multiplier- Minimum bars between entries- EMA cross mode- Whether EMA cross signals are used for orders- Pyramiding setting- Market regimeUsers should test the strategy on a sufficiently large sample of trades and across different market conditions before drawing conclusions. A small number of trades is not enough to evaluate a strategy reliably.How to use itA practical workflow is:1. Select the symbol and timeframe to test.2. Use a realistic date range that includes different market conditions.3. Review whether the strategy produces a sufficient number of trades.4. Adjust commission and slippage to match the market being tested.5. Review the impact of position size and pyramiding on drawdown.6. Compare results with and without pullback re-entry.7. Compare results with and without EMA cross signals being used for strategy orders.8. Forward-test before considering any real-world use.InputsDate Range- Start Date: first date included in the test.- End Date: last date included in the test.Moving Average- Fast EMA Length: controls the EMA used for trend direction, pullbacks, and cross signals.DMI / ADX- DI Length: DMI calculation period.- ADX Smoothing: smoothing period for ADX.- ADX minimum to trade: minimum ADX value required for qualifying trend entries.Pullback Re-entry- Enable pullback re-entry: enables or disables ATR-based pullback entries.- Pullback distance × ATR: controls how close price must pull back toward the EMA.- ATR Length: ATR period used for pullback distance.Signal Control- Minimum bars between entries: controls spacing between entries.EMA 40 Cross Signals- Use EMA 40 cross buy/sell signals: enables visual EMA cross signals.- EMA cross detection mode: chooses Close mode or Wick mode.- Use EMA cross signals in strategy orders: determines whether EMA cross signals affect actual strategy orders.Visual elementsThe script plots:- The EMA line, colored by slope.- Base entry markers.- Pullback add-entry markers.- Optional EMA cross buy/sell markers.- Hidden ADX and ADX threshold plots available for reference.LimitationsThis strategy is long-side focused and does not create independent short positions.The strategy can underperform during sideways or choppy market conditions, even with the ADX filter.EMA-based systems are inherently lagging because moving averages react to prior price data.ADX can confirm trend strength but does not determine trade direction by itself.Pullback and pyramiding logic can increase exposure and may increase drawdown.No strategy setting can guarantee profitability or future performance.Recommended useThis strategy is best used as an educational framework for testing EMA trend continuation, ATR-based pullback re-entry, ADX trend-strength filtering, and pyramiding behavior.It should be used with realistic backtesting assumptions, conservative risk controls, and additional independent analysis before any trading decision.