This strategy is an intelligent trading system based on price drop signals, combining dynamic take-profit and trailing stop-loss features. The strategy identifies potential buying opportunities by monitoring price drops while employing flexible profit-taking schemes and trailing stop mechanisms to protect profits. The core idea is to enter positions during significant price drops and maximize returns through intelligent position management.
The strategy operates through three core components: First, it identifies buy signals by setting a price drop percentage threshold (default -0.98%), triggering when a candle’s low price falls below the opening price multiplied by (1 + drop percentage). Second, it uses a fixed percentage (default 1.23%) as the target profit for setting take-profit levels. Finally, it incorporates a trailing stop mechanism (default 0.6%) to protect profits during price retracements. The strategy includes visualization components, displaying buy signals through various marker shapes.
This strategy builds a complete trading system by combining price drop signal identification, dynamic take-profit, and trailing stop-loss mechanisms. Its strengths lie in accurate signal identification and comprehensive risk management, though attention must be paid to false breakouts and parameter sensitivity risks. The strategy’s stability and profitability can be further enhanced by adding auxiliary indicators and optimizing parameter adjustment mechanisms. It provides a valuable strategic framework suitable for in-depth research and optimization.
/*backtest start: 2019-12-23 08:00:00 end: 2024-11-26 00:00:00 period: 1d basePeriod: 1d exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("Price Drop Buy Signal Strategy", overlay=true) // 输入参数 percentDrop = input.float(defval=-0.98, title="Price Drop Percentage", minval=-100, step=0.01) / 100 plotShapeStyle = input.string("shape_triangle_up", "Shape", options=["shape_xcross", "shape_cross", "shape_triangle_up", "shape_triangle_down", "shape_flag", "shape_circle", "shape_arrow_up", "shape_arrow_down", "shape_label_up", "shape_label_down", "shape_square", "shape_diamond"], tooltip="Choose the shape of the buy signal marker") targetProfit = input.float(1.23, title="目标利润百分比", step=0.01) / 100 trailingStopPercent = input.float(0.6, title="Trailing Stop Percentage", step=0.01) / 100 // 计算每根K线的涨跌幅 priceDrop = open * (1.0 + percentDrop) isBuySignal = low <= priceDrop // 在当前K线下方标注买入信号(可选) plotshape(series=isBuySignal, location=location.belowbar, color=color.green, style=plotShapeStyle, size=size.small, title="Buy Signal", text="Buy") // 显示信息 if bar_index == na label.new(x=bar_index, y=na, text=str.tostring(percentDrop * 100, format.mintick) + "% Drop", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_down, color=color.new(color.green, 0)) else label.delete(na) // 策略逻辑 if (isBuySignal) strategy.entry("买入", strategy.long) // 目标卖出价 if (strategy.position_size > 0) targetSellPrice = strategy.position_avg_price * (1 + targetProfit) strategy.exit("卖出", from_entry="买入", limit=targetSellPrice, trail_offset=strategy.position_avg_price * trailingStopPercent)