
PipShiesty Swagger là một chiến lược giao dịch kỹ thuật được thiết kế riêng cho TradingView. Chiến lược này sử dụng chỉ số biến động WaveTrend (WT) và giá trung bình trọng lượng giao dịch (VWAP) để xác định tín hiệu giao dịch tiềm năng, quản lý rủi ro và hình dung các điều kiện quá mua và quá bán trên biểu đồ giá. Chiến lược này sử dụng một loạt các chỉ số để tính toán chỉ số biến động EMA và tạo ra đường tín hiệu thông qua đường trung bình di chuyển đơn giản (SMA) để xác nhận tín hiệu giao dịch và lọc tiếng ồn.
Trung tâm của chiến lược PipShiesty Swagger là chỉ số WaveTrend oscillating (WT) và giá trung bình cân bằng khối lượng giao dịch (VWAP). WT sử dụng chiều dài kênh và chiều dài trung bình là hai tham số chính, và áp dụng moving average (EMA) cho giá trung bình thông qua một loạt các chỉ số.
PipShiesty Swagger là một chiến lược giao dịch kỹ thuật mạnh mẽ, được thiết kế dành riêng cho biểu đồ 15 phút BTC trên TradingView. Nó sử dụng chỉ số biến động WaveTrend và VWAP để xác định tín hiệu giao dịch tiềm năng, đồng thời kết hợp các tham số quản lý rủi ro để bảo vệ vốn. Mặc dù chiến lược này cho thấy triển vọng, nhưng các nhà giao dịch vẫn cần thận trọng khi thực hiện và xem xét các chiến lược tối ưu hóa để nâng cao hiệu suất và khả năng thích ứng của nó.
/*backtest
start: 2023-05-22 00:00:00
end: 2024-05-27 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("PipShiesty Swagger", overlay=true)
// WaveTrend Oscillator (WT)
n1 = input.int(10, "Channel Length")
n2 = input.int(21, "Average Length")
obLevel1 = input.float(60.0, "Overbought Level 1")
obLevel2 = input.float(53.0, "Overbought Level 2")
osLevel1 = input.float(-60.0, "Oversold Level 1")
osLevel2 = input.float(-53.0, "Oversold Level 2")
ap = hlc3
esa = ta.ema(ap, n1)
d = ta.ema(math.abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * d)
tci = ta.ema(ci, n2)
// VWAP
vwap = ta.vwma(close, n1)
// Signal Line
wt1 = tci
wt2 = ta.sma(wt1, 4)
// Bullish and Bearish Divergences
bullishDivergence = (ta.lowest(close, 5) > ta.lowest(close[1], 5)) and (wt1 < wt1[1]) and (close > close[1])
bearishDivergence = (ta.highest(close, 5) < ta.highest(close[1], 5)) and (wt1 > wt1[1]) and (close < close[1])
// Plot WaveTrend Oscillator
plot(wt1, title="WT1", color=color.blue)
plot(wt2, title="WT2", color=color.red)
// Remove printed signals if price reverses
var bool showBullishSignal = na
var bool showBearishSignal = na
if bullishDivergence
showBullishSignal := true
if bearishDivergence
showBearishSignal := true
// Reset signals if price reverses
if close < ta.lowest(close, 5)
showBullishSignal := false
if close > ta.highest(close, 5)
showBearishSignal := false
plotshape(series=showBullishSignal ? bullishDivergence : na, location=location.belowbar, color=color.green, style=shape.labelup, title="Bullish Divergence")
plotshape(series=showBearishSignal ? bearishDivergence : na, location=location.abovebar, color=color.red, style=shape.labeldown, title="Bearish Divergence")
// Risk Management Parameters
riskPercentage = input.float(1, title="Risk Percentage per Trade", minval=0.1, step=0.1) / 100
stopLossATR = input.float(1.5, title="Stop Loss ATR Multiplier", minval=0.5, step=0.1)
// ATR Calculation
atr = ta.atr(14)
// Position Size Calculation
calculatePositionSize(stopLoss) =>
riskAmount = strategy.equity * riskPercentage
positionSize = riskAmount / stopLoss
// Double the position size
positionSize *= 2
positionSize
// Entry and Exit Logic with Stop Loss
if bullishDivergence
stopLoss = low - atr * stopLossATR
positionSize = calculatePositionSize(close - stopLoss)
strategy.entry("Buy", strategy.long, qty=positionSize)
strategy.exit("Sell", from_entry="Buy", stop=stopLoss)
if bearishDivergence
strategy.close("Buy")
// Plot VWAP
plot(vwap, title="VWAP", color=color.orange)
// Background color to indicate Overbought/Oversold conditions
bgcolor(wt1 > obLevel1 ? color.new(color.red, 90) : na, title="Overbought Level 1")
bgcolor(wt1 < osLevel1 ? color.new(color.green, 90) : na, title="Oversold Level 1")
bgcolor(wt1 > obLevel2 ? color.new(color.red, 70) : na, title="Overbought Level 2")
bgcolor(wt1 < osLevel2 ? color.new(color.green, 70) : na, title="Oversold Level 2")