
This strategy is a high-frequency quantitative trading system that combines multiple timeframe trend analysis with volume-price relationships. It primarily uses Exponential Moving Averages (EMA) on 3-minute and 1-hour timeframes to determine market trends, while incorporating volume analysis to confirm trading signals, and implements a dual exit mechanism based on all-day highs and fixed time points.
The core logic consists of three main components: 1. Short-term trend determination: Uses a 50-period EMA on a 3-minute timeframe as a short-term trend indicator, considering an uptrend when price is above the EMA. 2. Volume confirmation: Compares current volume to the 20-period volume SMA, generating a volume spike signal when current volume exceeds 1.5 times the average. 3. Long-term trend filter: Incorporates a 50-period EMA on the 1-hour timeframe as a long-term trend filter, only allowing entries when price is above this EMA.
Entry signals require all three conditions to be met simultaneously. The exit strategy employs either reaching the day’s highest price or 3:00 PM, whichever comes first.
This strategy builds a relatively complete trading system by combining multiple timeframe analysis with volume-price relationships. Its strengths lie in clear logic and simple implementation, though risk control aspects still need optimization. Traders are advised to conduct thorough historical data testing and optimize parameters according to specific trading instrument characteristics before live implementation.
/*backtest
start: 2024-02-19 00:00:00
end: 2025-02-16 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Intraday + 1-Hour Trend Match", overlay=true)
// Inputs
emaLength3Min = input.int(50, title="EMA Length (3-Min)")
emaLength1Hr = input.int(50, title="EMA Length (1-Hour)")
volumeMultiplier = input.float(1.5, title="Volume Spike Multiplier")
// Intraday (3-Minute) EMA and Volume Spike
ema3Min = ta.ema(close, emaLength3Min)
volumeSMA = ta.sma(volume, 20)
isVolumeSpike = volume > (volumeSMA * volumeMultiplier)
// 1-Hour Trend (EMA)
ema1Hr = request.security(syminfo.tickerid, "60", ta.ema(close, emaLength1Hr))
is1HrUptrend = close > ema1Hr
// Intraday Signal
buyCondition3Min = close > ema3Min and isVolumeSpike
// Combined Signal: Match 3-Min Signal with 1-Hour Trend
finalBuyCondition = buyCondition3Min and is1HrUptrend
// All-Day High Tracking
var float allDayHigh = na
if (hour == 9 and minute == 0)
allDayHigh := high // Reset the all-day high at market open
else
allDayHigh := math.max(allDayHigh, high) // Update all-day high
// Debugging Plots
plot(ema3Min, color=color.blue, title="EMA 3-Min")
plot(ema1Hr, color=color.orange, title="EMA 1-Hour")
plotshape(isVolumeSpike, style=shape.circle, color=color.blue, title="Volume Spike (3-Min)")
plotshape(finalBuyCondition, style=shape.triangleup, color=color.green, title="Buy Signal")
plot(allDayHigh, color=color.red, title="All-Day High", linewidth=2)
// Strategy Execution
if (finalBuyCondition)
strategy.entry("Buy Signal", strategy.long)
// Exit Conditions
exitCondition = (close == allDayHigh) or (hour == 15 and minute >= 0)
if (exitCondition)
strategy.close("Buy Signal")