
你知道吗?这个策略就像是一个超级冷静的”泡沫侦探”!📊 当市场像打了鸡血一样疯狂上涨时,它不会跟风追高,而是耐心等待泡沫破裂的那一刻。就像看到朋友圈里疯狂炫富的人,你知道他可能很快就要”破产”了 😏
划重点! 这个策略有两个超聪明的入场时机: 1. 泡沫冷却模式:RSI飙到70以上或成交量暴增1.5倍时,策略会标记为”泡沫期”,然后耐心等待RSI回落到60以下才考虑做空 2. 新高陷阱模式:当价格创出20周期新高但没有泡沫信号时,直接做空
就像等公交车一样,不是每辆车都要上,要等对的那一班!🚌
避坑指南来了! 这个策略最厉害的地方是它的”预警系统”: - 如果你已经在做空,突然发现又开始泡沫了,立刻平仓跑路! - 止盈设置2%,止损设置6%,风险收益比1:3,数学期望值很香 📈 - 有专门的”禁止做空区域”,避免在危险时段操作
这个策略的图表比iPhone界面还好看! - 橙色背景 = 泡沫进行中,危险勿入 ⚠️ - 蓝色背景 = 泡沫后做空区域,机会来了 💙 - 红色背景 = 禁止做空区域,老实待着 - 各种小图标标记关键点位,一目了然
如果你是这样的交易者,这个策略简直是为你量身定制: - 不喜欢追涨杀跌的理性派 - 相信”涨得快跌得也快”的价值投资者 - 喜欢在别人贪婪时保持冷静的聪明人
记住:市场永远不缺机会,缺的是耐心等待好机会的智慧! ✨
/*backtest
start: 2025-09-15 00:00:00
end: 2025-10-14 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT","balance":500000}]
*/
//@version=5
strategy("Pump-Smart Shorting Strategy", overlay=true)
// Inputs
lookbackPeriod = input.int(20, "Lookback Period for New High", minval=5)
minProfitPerc = input.float(0.02, "Take Profit %", minval=0.001)
stopLossPerc = input.float(0.06, "Stop Loss %", minval=0.001)
hedgeTokens = input.int(1, "Hedge Tokens")
// Pump detection inputs
rsiPeriod = input.int(14, "RSI Period")
rsiHigh = input.float(70, "Pump RSI ≥")
rsiCool = input.float(60, "Pump cool-off RSI ≤")
volMult = input.float(1.5, "Volume Pump Multiplier")
pctUp = input.float(0.05, "1-bar Up % for Pump")
barsWait = input.int(0, "Bars to wait after pump ends", minval=0, maxval=10)
// Tech
rsi = ta.rsi(close, rsiPeriod)
avgVol = ta.sma(volume, 20)
oneBarUp = (close - close[1]) / close[1]
// Pump on if any strong up-move pattern
pumpOn = (rsi >= rsiHigh) or (volume > avgVol * volMult and oneBarUp > pctUp)
// Track pump state with var and transitions
var bool wasPump = false
pumpStart = not wasPump and pumpOn
pumpEnd = wasPump and not pumpOn
// Update state each bar
wasPump := pumpOn
// Count bars since pump ended
var int barsSincePumpEnd = 10000
barsSincePumpEnd := pumpEnd ? 0 : math.min(10000, barsSincePumpEnd + 1)
// Define "pump ended and cooled" condition
cooled = (rsi <= rsiCool) and (oneBarUp <= pctUp/2 or volume <= avgVol * (volMult * 0.8))
// Immediate short signal when pump finishes and cooled (with optional wait)
shortAfterPump = (barsSincePumpEnd >= barsWait) and cooled and not pumpOn and strategy.position_size == 0
// Also allow shorts on fresh new highs when not pumping (optional, keep for more entries)
isNewHigh = high > ta.highest(high, lookbackPeriod)[1]
shortOnPeak = isNewHigh and not pumpOn and strategy.position_size == 0
// Define conditions where we DON'T short (for red background)
noShortZone = pumpOn or (isNewHigh and pumpOn) or (barsSincePumpEnd < barsWait) or not cooled
// Preemptive close if pump turns on while short
var float shortEntry = na
inShort = strategy.position_size < 0 and not na(shortEntry)
if inShort and pumpOn
strategy.close("Short")
shortEntry := na
// Entry rules: short either right after pump ends OR on new high when not pumping
if (shortAfterPump or shortOnPeak) and strategy.position_size == 0
strategy.entry("Short", strategy.short, qty=hedgeTokens)
shortEntry := na
// Track entry price
if strategy.position_size < 0 and na(shortEntry)
shortEntry := strategy.position_avg_price
if strategy.position_size == 0
shortEntry := na
inShort := strategy.position_size < 0 and not na(shortEntry)
// TP/SL
tp = shortEntry * (1 - minProfitPerc)
sl = shortEntry * (1 + stopLossPerc)
exitTP = inShort and close <= tp
exitSL = inShort and close >= sl
if exitTP
strategy.close("Short")
if exitSL
strategy.close("Short")
// Visuals - REMOVED TEXT FROM ARROWS
plotshape(pumpStart, style=shape.circle, color=color.orange, location=location.abovebar, size=size.tiny)
plotshape(pumpEnd, style=shape.circle, color=color.teal, location=location.abovebar, size=size.tiny)
plotshape(shortAfterPump, style=shape.triangledown, color=color.blue, location=location.abovebar, size=size.small)
plotshape(shortOnPeak, style=shape.triangledown, color=color.red, location=location.abovebar, size=size.tiny)
plot(inShort ? shortEntry : na, color=color.blue, linewidth=2, title="Short Entry")
plot(inShort ? tp : na, color=color.green, linewidth=2, title="TP")
plot(inShort ? sl : na, color=color.red, linewidth=2, title="SL")
// Background colors - ADDED RED NO-SHORT ZONES
bgcolor(pumpOn ? color.new(color.orange, 92) : na, title="Pump Zone")
bgcolor(shortAfterPump ? color.new(color.blue, 92) : na, title="Post-Pump Short Zone")
bgcolor(noShortZone and not pumpOn ? color.new(color.red, 95) : na, title="No Short Zone")