Boot2

Boot2

//@version=5
strategy("Auto Trader Bot by ZSoft ", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)

// تنظیمات کاربر
vwmaLength = input.int(31, title="VWMA Length")
vwmaOffsetRatio = input.float(0.989, title="VWMA Offset Ratio")
emaBaseLength = input.int(19, title="EMA Base Length")
emaOffsetRatio = input.float(0.912, title="EMA Offset Ratio")
rsiThreshold = input.int(52, title="RSI Threshold")
ema15mLength = input.int(30, title="15m EMA Length")
tradeStartHour = input.int(9, title="Trade Start Hour")
tradeEndHour = input.int(19, title="Trade End Hour")

// اندیکاتورها
vwma = ta.vwma(close, vwmaLength)
vwmaLine = vwma * vwmaOffsetRatio
emaLen = math.round(emaBaseLength * emaOffsetRatio)
emaLine = ta.ema(close, emaLen)
rsiVal = ta.rsi(close, 25)
ema15m = request.security(syminfo.tickerid, "15", ta.ema(close, ema15mLength))

// امتیاز سیگنال
score = 0
score += close < vwmaLine ? 1 : 0
score += close < emaLine ? 1 : 0
score += close < ema15m ? 1 : 0
score += rsiVal < rsiThreshold ? 1 : 0
score += rsiVal < 30 ? 1 : 0

// تحلیل زمانی
inTime = (hour >= tradeStartHour and hour 0
lastTradeDay = dayofyear(time )
if lastTradeDay == today
dayProfit += strategy.closedtrades.profit(strategy.closedtrades - 1)

// شروع ترید فقط وقتی:
allowTrade = (dayProfit >= 0) and inTime

longCond = score >= 4 and allowTrade
shortCond = score

Read More

Share:

Latest News