OPEN-SOURCE SCRIPT
Forex Liner SCALPING (No Repaint)

//version=5
indicator("Forex Liner SCALPING (No Repaint)", overlay=true, max_labels_count=500)
// ===== إعدادات سريعة للسكالبينج =====
pivotLen = input.int(1, "Pivot Sensitivity (أدق=1)")
emaLen = input.int(9, "EMA Trend")
rsiLen = input.int(7, "RSI Filter")
rsiMid = input.int(50, "RSI Mid Level")
showLabels = input.bool(true, "Show Labels")
// ===== الحسابات =====
ema = ta.ema(close, emaLen)
rsi = ta.rsi(close, rsiLen)
ph = ta.pivothigh(high, pivotLen, pivotLen)
pl = ta.pivotlow(low, pivotLen, pivotLen)
// ===== حفظ آخر قاع وقمة =====
var float lastLowPrice = na
var int lastLowBar = na
var float lastHighPrice = na
var int lastHighBar = na
if not na(pl)
lastLowPrice := pl
lastLowBar := bar_index - pivotLen
if not na(ph)
lastHighPrice := ph
lastHighBar := bar_index - pivotLen
// ===== موجة =====
var int wave = 0 // 1 شراء | -1 بيع
// ===== بداية موجة شراء =====
startBuy = not na(lastHighPrice) and close > lastHighPrice and wave != 1 and rsi > rsiMid
if startBuy and not na(lastLowBar)
wave := 1
if showLabels
label.new(lastLowBar, lastLowPrice, "BUY LOW", style=label.style_label_up, color=color.lime, textcolor=color.black)
// ===== بداية موجة بيع =====
startSell = not na(lastLowPrice) and close < lastLowPrice and wave != -1 and rsi < rsiMid
if startSell and not na(lastHighBar)
wave := -1
if showLabels
label.new(lastHighBar, lastHighPrice, "SELL HIGH", style=label.style_label_down, color=color.red, textcolor=color.white)
// ===== نهاية الموجة =====
endBuy = wave == 1 and close < lastLowPrice
if endBuy
wave := 0
if showLabels
label.new(bar_index, high, "END BUY", color=color.orange, style=label.style_label_down)
endSell = wave == -1 and close > lastHighPrice
if endSell
wave := 0
if showLabels
label.new(bar_index, low, "END SELL", color=color.orange, style=label.style_label_up)
indicator("Forex Liner SCALPING (No Repaint)", overlay=true, max_labels_count=500)
// ===== إعدادات سريعة للسكالبينج =====
pivotLen = input.int(1, "Pivot Sensitivity (أدق=1)")
emaLen = input.int(9, "EMA Trend")
rsiLen = input.int(7, "RSI Filter")
rsiMid = input.int(50, "RSI Mid Level")
showLabels = input.bool(true, "Show Labels")
// ===== الحسابات =====
ema = ta.ema(close, emaLen)
rsi = ta.rsi(close, rsiLen)
ph = ta.pivothigh(high, pivotLen, pivotLen)
pl = ta.pivotlow(low, pivotLen, pivotLen)
// ===== حفظ آخر قاع وقمة =====
var float lastLowPrice = na
var int lastLowBar = na
var float lastHighPrice = na
var int lastHighBar = na
if not na(pl)
lastLowPrice := pl
lastLowBar := bar_index - pivotLen
if not na(ph)
lastHighPrice := ph
lastHighBar := bar_index - pivotLen
// ===== موجة =====
var int wave = 0 // 1 شراء | -1 بيع
// ===== بداية موجة شراء =====
startBuy = not na(lastHighPrice) and close > lastHighPrice and wave != 1 and rsi > rsiMid
if startBuy and not na(lastLowBar)
wave := 1
if showLabels
label.new(lastLowBar, lastLowPrice, "BUY LOW", style=label.style_label_up, color=color.lime, textcolor=color.black)
// ===== بداية موجة بيع =====
startSell = not na(lastLowPrice) and close < lastLowPrice and wave != -1 and rsi < rsiMid
if startSell and not na(lastHighBar)
wave := -1
if showLabels
label.new(lastHighBar, lastHighPrice, "SELL HIGH", style=label.style_label_down, color=color.red, textcolor=color.white)
// ===== نهاية الموجة =====
endBuy = wave == 1 and close < lastLowPrice
if endBuy
wave := 0
if showLabels
label.new(bar_index, high, "END BUY", color=color.orange, style=label.style_label_down)
endSell = wave == -1 and close > lastHighPrice
if endSell
wave := 0
if showLabels
label.new(bar_index, low, "END SELL", color=color.orange, style=label.style_label_up)
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.