180 lines
11 KiB
Markdown
180 lines
11 KiB
Markdown
|
|||
|
|
> Name
|
||
|
|
|
||
|
|
基于BTC15分钟图表的技术交易策略-Technical-Trading-Strategy-for-BTC-15-minute-Chart
|
||
|
|
|
||
|
|
> Author
|
||
|
|
|
||
|
|
ChaoZhang
|
||
|
|
|
||
|
|
> Strategy Description
|
||
|
|
|
||
|
|

|
||
|
|
|
||
|
|
[trans]
|
||
|
|
#### 概述
|
||
|
|
PipShiesty Swagger是一个专为TradingView设计的技术交易策略。该策略利用WaveTrend震荡指标(WT)和成交量加权平均价格(VWAP)来识别潜在的交易信号,管理风险,并在价格图表上可视化超买和超卖条件。该策略使用一系列指数移动平均线(EMA)计算震荡指标,并通过简单移动平均线(SMA)生成信号线,以确认交易信号并过滤噪音。同时,该策略还包括风险管理参数,如每笔交易的风险百分比和基于平均真实范围(ATR)的止损倍数,以管理风险和保护资本。
|
||
|
|
|
||
|
|
#### 策略原理
|
||
|
|
PipShiesty Swagger策略的核心是WaveTrend震荡指标(WT)和成交量加权平均价格(VWAP)。WT使用通道长度和平均长度两个主要参数,通过一系列指数移动平均线(EMA)应用于平均价格来计算。这样可以生成一个复合指数,然后进一步平滑处理。VWAP在指定时间段内计算,用作基准来了解相对于成交量的平均交易价格,有助于确定整体趋势方向。该策略定义了识别超买和超卖条件的特定水平。当震荡指标超过这些水平时,表明潜在的市场转折点。策略还包括一条信号线,它是WaveTrend震荡指标的简单移动平均线(SMA),有助于确认交易信号并过滤噪音。
|
||
|
|
|
||
|
|
#### 策略优势
|
||
|
|
1. PipShiesty Swagger策略结合了多个技术指标,如WaveTrend震荡指标、VWAP和ATR,提供了全面的市场分析。
|
||
|
|
2. 该策略能够识别潜在的看涨和看跌背离,为交易者提供潜在的交易机会。
|
||
|
|
3. 通过定义超买和超卖水平,该策略可以帮助交易者识别潜在的市场转折点。
|
||
|
|
4. 该策略包含风险管理参数,如每笔交易的风险百分比和基于ATR的止损倍数,有助于管理风险和保护资本。
|
||
|
|
5. 该策略在图表上提供清晰的视觉指示,如WaveTrend震荡指标、信号线、VWAP和背景颜色,使交易者能够轻松解读市场状况。
|
||
|
|
|
||
|
|
#### 策略风险
|
||
|
|
1. PipShiesty Swagger策略依赖于技术指标,可能会产生误导性信号,尤其是在市场波动较大或趋势不明确时。
|
||
|
|
2. 该策略的表现可能受到参数选择的影响,如通道长度、平均长度和超买/超卖水平。不恰当的参数设置可能导致次优结果。
|
||
|
|
3. 尽管该策略包含风险管理参数,但仍然存在潜在的资本损失风险,特别是在剧烈的市场波动期间。
|
||
|
|
4. 该策略主要关注BTC的15分钟图表,可能无法捕捉到其他时间范围内的重要市场变动。
|
||
|
|
|
||
|
|
#### 策略优化方向
|
||
|
|
1. 考虑纳入其他技术指标或市场情绪指标,以提高信号的可靠性和准确性。
|
||
|
|
2. 对策略参数进行优化和敏感性分析,以确定最佳设置并提高策略性能。
|
||
|
|
3. 引入动态止损和止盈机制,以更好地管理风险并最大限度地提高潜在回报。
|
||
|
|
4. 将该策略扩展到其他时间范围和交易工具,以捕捉更广泛的市场机会。
|
||
|
|
|
||
|
|
#### 总结
|
||
|
|
PipShiesty Swagger是一个强大的技术交易策略,专为TradingView上的BTC15分钟图表设计。它利用WaveTrend震荡指标和VWAP来识别潜在的交易信号,同时结合风险管理参数来保护资本。尽管该策略展示了前景,但交易者在实施时仍需谨慎,并考虑优化策略以提高其性能和适应性。通过不断完善和调整,PipShiesty Swagger可能成为交易者在动态加密货币市场中的宝贵工具。
|
||
|
|
|
||
|
|
||
|
||
|
|
|
||
|
|
#### Overview
|
||
|
|
PipShiesty Swagger is a technical trading strategy designed specifically for TradingView. The strategy leverages the WaveTrend Oscillator (WT) and Volume Weighted Average Price (VWAP) to identify potential trade signals, manage risk, and visualize overbought and oversold conditions on a price chart. The oscillator is calculated using a series of exponential moving averages (EMA) applied to the average price, resulting in a composite index that is further smoothed. The strategy also includes a signal line, which is a simple moving average (SMA) of the WaveTrend Oscillator, to confirm trade signals and filter out noise. Additionally, the strategy incorporates risk management parameters, such as a risk percentage per trade and a stop loss multiplier based on the Average True Range (ATR), to manage risk and protect capital.
|
||
|
|
|
||
|
|
#### Strategy Principles
|
||
|
|
The core of the PipShiesty Swagger strategy lies in the WaveTrend Oscillator (WT) and the Volume Weighted Average Price (VWAP). The WT uses two primary parameters, the channel length and the average length, to calculate the oscillator using a series of exponential moving averages (EMA) applied to the average price. This results in a composite index, which is then further smoothed. The VWAP is calculated over a specified period and used as a benchmark to understand the average trading price relative to volume, helping to identify the overall trend direction. The strategy defines specific levels for identifying overbought and oversold conditions. When the oscillator exceeds these levels, it indicates potential market turning points. The strategy also includes a signal line, which is a simple moving average (SMA) of the WaveTrend Oscillator, to help confirm trade signals and filter out noise.
|
||
|
|
|
||
|
|
#### Strategy Advantages
|
||
|
|
1. The PipShiesty Swagger strategy combines multiple technical indicators, such as the WaveTrend Oscillator, VWAP, and ATR, providing a comprehensive analysis of the market.
|
||
|
|
2. The strategy can identify potential bullish and bearish divergences, offering traders potential trading opportunities.
|
||
|
|
3. By defining overbought and oversold levels, the strategy can help traders identify potential market turning points.
|
||
|
|
4. The strategy includes risk management parameters, such as a risk percentage per trade and a stop loss multiplier based on ATR, which helps manage risk and protect capital.
|
||
|
|
5. The strategy provides clear visual indications on the chart, such as the WaveTrend Oscillator, signal line, VWAP, and background colors, making it easy for traders to interpret market conditions.
|
||
|
|
|
||
|
|
#### Strategy Risks
|
||
|
|
1. The PipShiesty Swagger strategy relies on technical indicators and may generate misleading signals, particularly during periods of high market volatility or unclear trends.
|
||
|
|
2. The strategy's performance may be influenced by the choice of parameters, such as channel length, average length, and overbought/oversold levels. Incorrect parameter settings may lead to suboptimal results.
|
||
|
|
3. Although the strategy includes risk management parameters, there is still a potential risk of capital loss, especially during extreme market fluctuations.
|
||
|
|
4. The strategy primarily focuses on the 15-minute chart for BTC and may fail to capture important market movements in other timeframes.
|
||
|
|
|
||
|
|
#### Strategy Optimization Directions
|
||
|
|
1. Consider incorporating additional technical indicators or market sentiment indicators to improve signal reliability and accuracy.
|
||
|
|
2. Optimize and conduct sensitivity analysis on the strategy parameters to determine the optimal settings and enhance strategy performance.
|
||
|
|
3. Introduce dynamic stop-loss and take-profit mechanisms to better manage risk and maximize potential returns.
|
||
|
|
4. Expand the strategy to other timeframes and trading instruments to capture a wider range of market opportunities.
|
||
|
|
|
||
|
|
#### Summary
|
||
|
|
PipShiesty Swagger is a powerful technical trading strategy designed for the BTC 15-minute chart on TradingView. It utilizes the WaveTrend Oscillator and VWAP to identify potential trading signals while incorporating risk management parameters to protect capital. Although the strategy shows promise, traders should exercise caution when implementing it and consider optimizing the strategy to improve its performance and adaptability. With continuous refinement and adjustment, PipShiesty Swagger could become a valuable tool for traders navigating the dynamic cryptocurrency market.
|
||
|
|
[/trans]
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
> Source (PineScript)
|
||
|
|
|
||
|
|
``` pinescript
|
||
|
|
/*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")
|
||
|
|
|
||
|
|
```
|
||
|
|
|
||
|
|
> Detail
|
||
|
|
|
||
|
|
https://www.fmz.com/strategy/452697
|
||
|
|
|
||
|
|
> Last Modified
|
||
|
|
|
||
|
|
2024-05-28 11:15:29
|