
This strategy is a technical indicator-based intraday scalping system that primarily utilizes the relationship between the 20-period Exponential Moving Average (EMA 20) and the Volume Weighted Average Price (VWAP) calculated using typical price to determine trading signals. The strategy employs dynamic stop-loss and profit target settings, precisely calculating risk-reward ratios through ATR (Average True Range) and the size of the weapon candle (signal candle), thereby achieving a balance between risk control and profit maximization. This strategy is particularly suitable for volatile market environments, capturing profits by identifying turning points in short-term price trends.
The core principle of this strategy is based on the crossover relationship between two moving averages (EMA 20 and anchored VWAP) and the interaction of price with these averages. Specifically:
Entry Signal Generation Mechanism:
Application of Typical Price: The strategy uses typical price (high + low + close)/3 to calculate VWAP, providing more comprehensive price information than using closing price alone.
Intraday Anchored VWAP: VWAP resets at the beginning of each trading day, ensuring the indicator reflects the price-volume relationship of the current day, suitable for intraday traders.
Dynamic Risk Management:
Risk-Reward Ratio: The strategy defaults to a 1:3 risk-reward ratio, meaning the potential reward is three times the potential risk, aligning with professional traders’ risk management standards.
Integration of Technical Indicators: Combines the trend-following capability of EMA with the volume-weighted advantage of VWAP, making signals more reliable.
Volatility-Adaptive Dynamic Stop Loss: Calculates stop loss positions through ATR, allowing stop loss points to automatically adjust according to actual market volatility, avoiding the inflexibility of fixed stop loss points in different volatile environments.
Candle Size-Based Target Setting: Uses the actual size of the signal candle to determine target prices, a method that better adapts to the current market’s volatility characteristics, setting farther targets in high volatility and closer targets in low volatility.
Daily Reset VWAP Calculation: Recalculates VWAP every trading day, avoiding interference from historical data on the current trading day, providing a clearer intraday price reference.
Multiple Confirmation Mechanism: Requires combined conditions of moving average crossovers and price crossovers, reducing the possibility of false signals and improving trading accuracy.
Intuitive Visualization: The strategy provides clear graphic markers, including buy/sell signals, stop loss, and target price lines, allowing traders to intuitively understand and execute trading decisions.
Moving Average Lag Risk: Although EMA responds faster than simple moving averages, it still has a certain lag, potentially causing missed optimal entry points or delayed signals in rapidly changing markets.
VWAP Calculation Dependency on Volume: In cases of abnormal volume, such as large single trades by institutional investors, VWAP may deviate, affecting signal accuracy.
Trading Frequency Risk: In oscillating markets, moving averages may cross frequently, leading to overtrading and increased transaction costs.
Stop Loss Trigger Risk: The market may experience short-term price spikes, triggering stop losses before returning to the original trend direction, causing unnecessary losses.
Limitations of Target Price Setting: Target setting based on a single candle’s size may not be sufficient to adapt to all market conditions, especially when market structure changes.
Solutions: - Consider adding additional filtering conditions, such as volume confirmation or trend strength indicators, to reduce false signals. - For stop loss settings, consider using trailing stops or support/resistance-based stops, rather than relying solely on ATR. - Implement time filters to avoid trading during high volatility periods at market open and close. - Regularly backtest and optimize parameters to ensure strategy effectiveness in the current market environment.
Parameter Optimization:
Add Market Environment Filters:
Time Filtering:
Stop Loss and Take Profit Optimization:
Multi-Timeframe Analysis Integration:
The implementation of these optimization directions can significantly improve the robustness and profitability of the strategy, but care must be taken not to over-optimize leading to overfitting issues. Each improvement should be validated through rigorous backtesting and forward testing.
The Dynamic Dual-Moving Average Crossover Strategy with Typical Price Anchored VWAP and ATR-Based Risk Management is a comprehensive trading system combining multiple technical analysis tools. It identifies potential trading opportunities through the relationship between EMA 20 and VWAP calculated with typical price, and uses a dynamic risk management mechanism based on ATR and candle size to control risk and optimize returns.
The main advantage of the strategy lies in its ability to adapt to market volatility and the signal reliability provided by combining multiple technical indicators. However, it also faces risks such as moving average lag and overtrading, which need to be mitigated through additional filtering conditions and parameter optimization.
For intraday traders, this strategy provides a systematic trading framework, particularly suitable for those seeking to capture short-term market opportunities while maintaining reasonable risk control. Through continuous backtesting, optimization, and practice, traders can further refine this strategy according to their risk tolerance and trading objectives, turning it into a personalized, robust trading system.
/*backtest
start: 2024-07-25 00:00:00
end: 2025-07-23 08:00:00
period: 2d
basePeriod: 2d
exchanges: [{"eid":"Futures_Binance","currency":"SOL_USDT"}]
*/
//@version=5
strategy("EMA 20 and Anchored VWAP with Typical Price", overlay=true)
// === INPUTS ===
emaLength = input.int(20, title="EMA Length")
atrMultiplier = input.float(2.0, title="Stop Loss Multiplier (x ATR)", minval=1)
riskRewardRatio = input.float(3.0, title="Risk/Reward Ratio", minval=1, step=0.1) // 1:3 Risk/Reward Ratio
// === CALCULATIONS ===
// EMA 20
ema20 = ta.ema(close, emaLength)
// === TYPICAL PRICE ===
typicalPrice = (high + low + close) / 3
// === VWAP CALCULATION (ANCHOR PERIOD = SESSION) ===
// Reset at the start of each session (new day)
var float cumPriceVol = na
var float cumVol = na
if (dayofweek != dayofweek[1]) // Reset at the start of each day
cumPriceVol := typicalPrice * volume
cumVol := volume
else
cumPriceVol := cumPriceVol + (typicalPrice * volume)
cumVol := cumVol + volume
vwap = cumPriceVol / cumVol // VWAP = cumulative price-volume / cumulative volume
// ATR Calculation
atr = ta.atr(14)
// === BUY CONDITIONS ===
// EMA 20 above VWAP and close crosses EMA 20 from below, OR EMA 20 crosses VWAP from below
buyCondition = (ema20 > vwap and ta.crossover(close, ema20)) or ta.crossover(ema20, vwap)
// === SELL CONDITIONS ===
// EMA 20 below VWAP and close crosses EMA 20 from above, OR EMA 20 crosses VWAP from above
sellCondition = (ema20 < vwap and ta.crossunder(close, ema20)) or ta.crossunder(ema20, vwap)
// === STOP LOSS and TARGET ===
// Buy Stop Loss and Target calculation (Weapon Candle is the signal candle)
buyStopLoss = close - atr * atrMultiplier
// Weapon Candle (signal candle) for Buy
weaponCandleSize = high - low
buyTarget = high + 2 * weaponCandleSize // Target = High of weapon candle + 2 * candle size
// Sell Stop Loss and Target calculation (Weapon Candle is the signal candle)
sellStopLoss = close + atr * atrMultiplier
// Weapon Candle (signal candle) for Sell
weaponCandleSizeSell = high - low
sellTarget = low - 2 * weaponCandleSizeSell // Target = Low of weapon candle - 2 * candle size
// === EXECUTE STRATEGY (Buy and Sell) ===
// Buy order entry
if (buyCondition)
strategy.entry("Buy", strategy.long, stop=buyStopLoss, limit=buyTarget)
// Sell order entry
if (sellCondition)
strategy.entry("Sell", strategy.short, stop=sellStopLoss, limit=sellTarget)
// === PLOTS ===
// Plot EMA 20
plot(ema20, color=color.blue, title="EMA 20", linewidth=2)
// Plot VWAP
plot(vwap, color=color.orange, title="Session Anchored VWAP", linewidth=2)
// Plot Buy and Sell signals on the chart
plotshape(series=buyCondition, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal", text="BUY")
plotshape(series=sellCondition, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal", text="SELL")
// === BACKGROUND COLORS ===
bgcolor(buyCondition ? color.new(color.green, 90) : na, title="Buy Background")
bgcolor(sellCondition ? color.new(color.red, 90) : na, title="Sell Background")