5 min bot scalper tradingview
- User
5 min bot scalper tradingview
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
5 min bot scalper tradingview
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
در ادامه، یک ربات اسکالپر 5 دقیقهای برای تریدینگ ویو با استفاده از Pine Script ارائه میشود. این استراتژی ترکیبی از اندیکاتورهای RSI، EMA و Volume برای شناسایی سیگنالهای سریع اسکالپینگ استفاده میکند:
//@version=5
strategy("5-Minute Scalper Bot", overlay=true, margin_long=100, margin_short=100, commission_type=strategy.commission.percent, commission_value=0.1)
// ———————— تنظیمات ورودی ————————
fastLength = input.int(9, "طول EMA سریع")
slowLength = input.int(21, "طول EMA آهسته")
rsiLength = input.int(14, "طول RSI")
rsiOverbought = input.int(70, "سطح اشباع خرید RSI")
rsiOversold = input.int(30, "سطح اشباع فروش RSI")
volumeThreshold = input.float(1.5, "آستانه حجم", minval=1.0, step=0.1)
useStopLoss = input.bool(true, "استفاده از استاپ لاس")
stopLossPercent = input.float(0.5, "درصد استاپ لاس", minval=0.1, step=0.1)
useTrailing = input.bool(true, "استفاده از تریلینگ استاپ")
trailOffset = input.float(0.3, "افست تریلینگ استاپ", minval=0.1, step=0.1)
// ———————— محاسبات اندیکاتورها ————————
// میانگینهای متحرک
fastEMA = ta.ema(close, fastLength)
slowEMA = ta.ema(close, slowLength)
plot(fastEMA, "EMA سریع", color=color.new(color.blue, 0))
plot(slowEMA, "EMA آهسته", color=color.new(color.red, 0))
// RSI
rsi = ta.rsi(close, rsiLength)
plot(rsi, "RSI", color=color.new(color.purple, 0), linewidth=2)
// حجم
volumeAvg = ta.sma(volume, 20)
volumeSpike = volume > volumeAvg * volumeThreshold
bgcolor(volumeSpike ? color.new(color.orange, 90) : na)
// ———————— شرایط ورود ————————
bullishCrossover = ta.crossover(fastEMA, slowEMA)
bearishCrossover = ta.crossunder(fastEMA, slowEMA)
longCondition =
bullishCrossover and
rsi < rsiOverbought and
volumeSpike and
close > fastEMA
shortCondition =
bearishCrossover and
rsi > rsiOversold and
volumeSpike and
close < fastEMA
// ———————— مدیریت ریسک ————————
stopLoss = useStopLoss ? close * (stopLossPercent / 100) : na
trailPoints = useTrailing ? close * (trailOffset / 100) : na
// ———————— اجرای معاملات ————————
if (longCondition)
strategy.entry("Long", strategy.long)
if (useStopLoss)
strategy.exit("Exit Long", "Long", stop=close - stopLoss, trail_points=trailPoints, trail_offset=trailPoints)
if (shortCondition)
strategy.entry("Short", strategy.short)
if (useStopLoss)
strategy.exit("Exit Short", "Short", stop=close + stopLoss, trail_points=trailPoints, trail_offset=trailPoints)
// ———————— نمایش سیگنالها ————————
plotshape(longCondition, title="سیگنال خرید", text="خرید", location=location.belowbar, color=color.green, size=size.small)
plotshape(shortCondition, title="سیگنال فروش", text="فروش", location=location.abovebar, color=color.red, size=size.small)
میانگین متحرک (EMA):
RSI (شاخص قدرت نسبی):
حجم معاملات:
مدیریت ریسک:
میتوانید با تغییر پارامترها و اضافه کردن فیلترهای بیشتر، استراتژی را بهینهسازی کنید. پیشنهاد میکنم از ترکیب با الگوهای پرایس اکشن و سطوح کلیدی استفاده کنید.