بbounce حمایت و مقاومت
joiniobong

مشخصات معامله
قیمت در زمان انتشار:
۰.۱۶۴۱۹
توضیحات
//@version=5 strategy("استراتژی بounce اصلاحشده DOGE SR", overlay=true) // === ورودیها === sr_lookback = input.int(20, "دوره نگاه به SR", minval=5) bounce_tol = input.float(0.5, "حساسیت بounce (%)", minval=0.1, step=0.1) stop_pct = input.float(1.0, "حد ضرر (%)", minval=0.2) tp_pct = input.float(1.5, "Take Profit (%)", minval=0.2) // === سطوح حمایت / مقاومت === res = ta.highest(high, sr_lookback) sup = ta.lowest(low, sr_lookback) plot(res, color=color.red, linewidth=2, title="مقاومت") plot(sup, color=color.green, linewidth=2, title="حمایت") // === نواحی حساسیت === sup_zone_low = sup * (1 - bounce_tol / 100) sup_zone_high = sup * (1 + bounce_tol / 100) res_zone_low = res * (1 - bounce_tol / 100) res_zone_high = res * (1 + bounce_tol / 100) // === شرایط بounce === sup_bounce = ta.cross(close, sup_zone_low) and close < sup_zone_high res_bounce = ta.cross(close, res_zone_high) and close > res_zone_low // === تعداد چند لمسی === var int sup_touch_count = 0 var int res_touch_count = 0 if ta.cross(close, sup) sup_touch_count += 1 if ta.cross(close, res) res_touch_count += 1 // بازنشانی شمارش اگر قیمت دور شده باشد if close < sup * 0.97 sup_touch_count := 0 if close > res * 1.03 res_touch_count := 0 valid_sup = sup_touch_count >= 2 and sup_bounce valid_res = res_touch_count >= 2 and res_bounce // === تأیید حجم === vol_ma = ta.sma(volume, 20) high_vol = volume > vol_ma // === فیلتر RSI === rsi = ta.rsi(close, 14) rsi_filter_long = rsi < 60 rsi_filter_short = rsi > 40 // === شرایط نهایی ورود === long_cond = valid_sup and high_vol and rsi_filter_long short_cond = valid_res and high_vol and rsi_filter_short // === نقاط ورود را نمایش دهید === plotshape(long_cond, title="سیگنال خرید", style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small) plotshape(short_cond, title="سیگنال فروش", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small) // === ورودیهای استراتژی === if (long_cond) strategy.entry("Bounce خرید", strategy.long) if (short_cond) strategy.entry("Bounce فروش", strategy.short) // === خروجیهای استراتژی === if strategy.position_size > 0 strategy.exit("TP/SL خرید", "Bounce خرید", stop = strategy.position_avg_price * (1 - stop_pct / 100), limit = strategy.position_avg_price * (1 + tp_pct / 100)) if strategy.position_size < 0 strategy.exit("TP/SL فروش", "Bounce فروش", stop = strategy.position_avg_price * (1 + stop_pct / 100), limit = strategy.position_avg_price * (1 - tp_pct / 100))