OPEN-SOURCE SCRIPT
ที่อัปเดต:

Dhanvaan Style Advanced Scalper V2 Pro - Fixed Alerts with OI

318
This strategy required on the bases of rsi ema macd and super trend which gives us trend and entery exit or target
Release Note
this script based on rsi macd supertrend
Release Note
//version=6
indicator("Dhanvaan Style Advanced Scalper V14 - MOMENTUM LOCK", overlay=true)

// ===== Inputs =====
fastLen = input.int(9, "Fast EMA")
slowLen = input.int(21, "Slow EMA")
coolDown = input.int(12, "Signal Cool-Down Bars") // एक सिग्नल के बाद इतने बार तक नया सिग्नल नहीं आएगा

// ===== Indicators =====
emaFast = ta.ema(close, fastLen)
emaSlow = ta.ema(close, slowLen)
vwapValue = ta.vwap(close)

// EMA का झुकाव (Slope) - फ्लैट मार्केट में री-एंट्री रोकने के लिए
fastSlopeBuy = emaFast > emaFast[2]
fastSlopeSell = emaFast < emaFast[2]

// Core Triggers
baseCrossBuy = ta.crossover(emaFast, emaSlow)
baseCrossSell = ta.crossunder(emaFast, emaSlow)

// री-एंट्री के लिए अब EMA का मजबूत स्लोप में होना जरूरी है
pullbackBuy = (low <= emaFast and close > emaFast and close > high[1] and emaFast > emaSlow and fastSlopeBuy)
pullbackSell = (high >= emaFast and close < emaFast and close < low[1] and emaFast < emaSlow and fastSlopeSell)

buyTrigger = (baseCrossBuy or pullbackBuy) and close > emaSlow and close > vwapValue
sellTrigger = (baseCrossSell or pullbackSell) and close < emaSlow and close < vwapValue

// ===== STATE MANAGEMENT WITH COOL-DOWN =====
var string currentTrend = "NONE"
var int lastSignalBar = 0
buySignal = false
sellSignal = false

// बार काउंट चेक करने के लिए ताकि बार-बार सिग्नल स्पैम न हो
barsSinceLast = bar_index - lastSignalBar

if buyTrigger and currentTrend != "BUY" and (barsSinceLast > coolDown or baseCrossBuy)
buySignal := true
currentTrend := "BUY"
lastSignalBar := bar_index

if sellTrigger and currentTrend != "SELL" and (barsSinceLast > coolDown or baseCrossSell)
sellSignal := true
currentTrend := "SELL"
lastSignalBar := bar_index

// ट्रेंड रीसेट केवल तभी होगा जब प्राइस स्पष्ट रूप से 21 EMA के विपरीत बंद हो
if currentTrend == "BUY" and close < emaSlow
currentTrend := "NONE"

if currentTrend == "SELL" and close > emaSlow
currentTrend := "NONE"

// ===== Plotting =====
plot(emaFast, color=color.green, linewidth=2, title="EMA 9")
plot(emaSlow, color=color.red, linewidth=2, title="EMA 21")
plot(vwapValue, color=color.blue, linewidth=1, title="VWAP", style=plot.style_stepline)

plotshape(buySignal, title="BUY", style=shape.labelup, location=location.belowbar, color=color.green, text="BUY", textcolor=color.white, size=size.normal)
plotshape(sellSignal, title="SELL", style=shape.labeldown, location=location.abovebar, color=color.red, text="SELL", textcolor=color.white, size=size.normal)

// ===== Dynamic Risk & Targets =====
buySL = math.min(low, low[1])
sellSL = math.max(high, high[1])

buyRisk = close - buySL
sellRisk = sellSL - close

buyTarget1 = close + buyRisk
buyTarget2 = close + buyRisk * 2
buyTarget3 = close + buyRisk * 3

sellTarget1 = close - sellRisk
sellTarget2 = close - sellRisk * 2
sellTarget3 = close - sellRisk * 3

// ===== Dashboard Data =====
var float entryPrice = na
var float currentSL = na
var float target1 = na
var float target2 = na
var float target3 = na
var string tradeType = "WAITING"

if (buySignal)
tradeType := "BUY"
entryPrice := close
currentSL := buySL
target1 := buyTarget1
target2 := buyTarget2
target3 := buyTarget3

if (sellSignal)
tradeType := "SELL"
entryPrice := close
currentSL := sellSL
target1 := sellTarget1
target2 := sellTarget2
target3 := sellTarget3

// Table Design
var table tradeTable = table.new(position = position.top_right, columns = 2, rows = 6, bgcolor = color.new(#1e222d, 10), border_width = 1, border_color = color.gray)

if barstate.islast
color signalColor = (tradeType == "BUY") ? color.green : (tradeType == "SELL") ? color.red : color.gray
table.cell(tradeTable, 0, 0, "TRADE LOGIC:", text_color=color.white, text_size=size.small, bgcolor=color.new(color.gray, 50))
table.cell(tradeTable, 1, 0, tradeType, text_color=color.white, text_size=size.small, bgcolor=signalColor)
table.cell(tradeTable, 0, 1, "ENTRY PRICE:", text_color=color.white, text_size=size.small)
table.cell(tradeTable, 1, 1, na(entryPrice) ? "-" : str.tostring(entryPrice, "#.##"), text_color=color.yellow, text_size=size.small)
table.cell(tradeTable, 0, 2, "TARGET 1:", text_color=color.white, text_size=size.small)
table.cell(tradeTable, 1, 2, na(target1) ? "-" : str.tostring(target1, "#.##"), text_color=color.lime, text_size=size.small)
table.cell(tradeTable, 0, 3, "TARGET 2:", text_color=color.white, text_size=size.small)
table.cell(tradeTable, 1, 3, na(target2) ? "-" : str.tostring(target2, "#.##"), text_color=color.lime, text_size=size.small)
table.cell(tradeTable, 0, 4, "TARGET 3:", text_color=color.white, text_size=size.small)
table.cell(tradeTable, 1, 4, na(target3) ? "-" : str.tostring(target3, "#.##"), text_color=color.lime, text_size=size.small)
table.cell(tradeTable, 0, 5, "STOP LOSS (SL):", text_color=color.white, text_size=size.small)
table.cell(tradeTable, 1, 5, na(currentSL) ? "-" : str.tostring(currentSL, "#.##"), text_color=color.orange, text_size=size.small)

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน