نموذج//@version=5
indicator("متابعة سهم الغاز وتعليم ريت", overlay=true)
symbolGas = "TADAWUL:2080"
symbolTalim = "TADAWUL:4331"
// المتوسطات
ema9 = ta.ema(close, 9)
ema21 = ta.ema(close, 21)
volMA = ta.sma(volume, 20)
// إشارات تقاطع
bullishCross = ta.crossover(ema9, ema21)
rsi = ta.rsi(close, 14)
volSpike = volume > volMA
// إشارة دخول
entrySignal = bullishCross and rsi > 55 and volSpike
plotshape(entrySignal, location=location.belowbar, color=color.green, style=shape.labelup, text="دخول")
// عرض المتوسطات
plot(ema9, color=color.orange)
plot(ema21, color=color.blue)
ابحث في الأفكار لـ "Version"
ااا//@version=5
indicator("MFI Entry/Exit Signals", overlay=true, shorttitle="MFI Signals")
// إعدادات المؤشر
length = input.int(14, title="MFI Length")
overbought = input.int(80, title="Overbought Level")
oversold = input.int(20, title="Oversold Level")
// حساب مؤشر تدفق السيولة (MFI)
mfi = ta.mfi(close, high, low, volume, length)
// إشارات الشراء والبيع
longCondition = (mfi < oversold) and (ta.crossover(mfi, oversold))
shortCondition = (mfi > overbought) and (ta.crossunder(mfi, overbought))
// رسم الإشارات
plotshape(series=longCondition, location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=shortCondition, location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// رسم الـ MFI على الشارت
hline(overbought, "Overbought", color=color.red, linewidth=1, linestyle=hline.style_dotted)
hline(oversold, "Oversold", color=color.green, linewidth=1, linestyle=hline.style_dotted)
plot(mfi, color=color.blue, linewidth=2)
اماكن شراء مع الاهداف//@version=5
indicator("Buy/Sell Signals with TP1 & TP2", overlay=true)
// إعدادات المؤشر
length = input(14, title="Length")
src = close
// حساب متوسط الحركة والمتذبذب
ema_fast = ta.ema(src, length)
ema_slow = ta.ema(src, length * 2)
// إشارات الشراء والبيع
buySignal = ta.crossover(ema_fast, ema_slow)
sellSignal = ta.crossunder(ema_fast, ema_slow)
// تحديد أهداف الربح
tp1 = close + (close * 0.01) // 1% هدف
tp2 = close + (close * 0.02) // 2% هدف
// رسم الإشارات على الشارت
plotshape(series=buySignal, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal")
plotshape(series=sellSignal, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal")
// عرض TP1 و TP2
label = "TP1: " + str.tostring(tp1) + "\nTP2: " + str.tostring(tp2)
label_pos = buySignal ? close + 10 : na
label_new = label_pos ? label : na
label1 = label_new != na ? label.new(x=time, y=label_pos, text=label, color=color.blue, textcolor=color.white, size=size.small) : na
كوفي النخيل //@version=5
indicator("NOVA ALGO", overlay = true)
// Get user input
nbuysell = input.bool(true, 'Buy/Sell Signal', inline = "BSNM",group='BUY/SELL SIGNAL')
nsensitivity = input.float(defval=2, title="-", inline = "BSNM", minval=1, maxval=20, group='BUY/SELL SIGNAL')
//candlecolor = input.bool(true, 'Buy/Sell Signal', inline = "BSNM",group='BUY/SELL SIGNAL')
// Trend Features
LongTrendAverage = input(true, 'Trend Cloud', group='TREND FEATURES')
TrendFollower = input(true, 'Trend Follower', group='TREND FEATURES')
ShowComulus = input(true, 'Comulus Cloud', group='TREND FEATURES')
CirrusCloud = input(true, 'Cirrus Cloud', group='TREND FEATURES')
enableReversal = input.bool(false, 'Dynamic TP 👁️ ', inline = 'overlayLine1', group = 'Settings')
// Risk Management
levels = input.bool(true, "Show TP/SL Levels" , group = "Risk Management" , inline = "MMDB2")
lvlLines = input.bool(true, "Show Lines ", inline="levels", group = "Risk Management")
linesStyle = input.string("SOLID", "", , inline="levels", group = "Risk Management")
lvlDistance = input.int(1, "Distance", 1, inline="levels2", group = "Risk Management")
lvlDecimals = input.int(2, " Decimals", 1, 8, inline="levels2", group = "Risk Management")
atrRisk = input.int(1, "Risk % ", 1, group = "Risk Management" , inline="levels3")
atrLen = input.int(14, " ATR Length", 1, group = "Risk Management" , inline="levels3")
decimals = lvlDecimals == 1 ? "#.#" : lvlDecimals == 2 ? "#.##" : lvlDecimals == 3 ? "#.###" : lvlDecimals == 4 ? "#.####" : lvlDecimals == 5 ? "#.#####" : lvlDecimals == 6 ? "#.######" : lvlDecimals == 7 ? "#.#######" : "#.########"
// Input settings
history_of_demand_to_keep = 20
show_zigzag = false
show_price_action_labels = false
showsr = input(true, title="Show Support & Resistance", group = 'Support & Resistance')
swing_length = input.int(defval=8, title="Sensitivity", group = 'Support & Resistance')
box_width = input.float(defval=4, title="Zone Width", group = 'Support & Resistance')
box_extend_option = input.string("Right", title="Extend Box", options= , group = 'Support & Resistance')
res = input.timeframe(title='Time Frame', defval='', group="Support & Resistance")
s1 = request.security(syminfo.tickerid, res, showsr, gaps=barmerge.gaps_on)
demand_color = input.color(color.rgb(0,188,212,70), title = 'Support & Resistance Color', group = 'Support & Resistance')
supply_color = input.color(color.rgb(178,40,51,70), title = '', group = 'Support & Resistance')
// Signal Generation
supertrend(_close, factor, atrLen) =>
atr = ta.atr(atrLen)
upperBand = _close + factor * atr
lowerBand = _close - factor * atr
prevLowerBand = nz(lowerBand )
prevUpperBand = nz(upperBand )
lowerBand := lowerBand > prevLowerBand or close < prevLowerBand ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or close > prevUpperBand ? upperBand : prevUpperBand
int direction = na
float superTrend = na
prevSuperTrend = superTrend
if na(atr )
direction := 1
else if prevSuperTrend == prevUpperBand
direction := close > upperBand ? -1 : 1
else
direction := close < lowerBand ? 1 : -1
superTrend := direction == -1 ? lowerBand : upperBand
// SMA
ocAvg = math.avg(open, close)
sma4 = ta.sma(close, 8)
sma5 = ta.sma(close, 9)
sma9 = ta.sma(close, 13)
psar = ta.sar(0.02, 0.02, 0.2)
//*in Easy Words Super Trend + SMA = Signals
= supertrend(close, nsensitivity*2, 11)
source = close, period = 150
// Colors
green = #2BBC4D, green2 = #00DD00
red = #C51D0B, red2 = #DD0000
adxlen = 15
dilen = 15
dirmov(len) =>
up = ta.change(high)
down = -ta.change(low)
plusDM = na(up) ? na : up > down and up > 0 ? up : 0
minusDM = na(down) ? na : down > up and down > 0 ? down : 0
truerange = ta.rma(ta.tr, len)
plus = fixnan(100 * ta.rma(plusDM, len) / truerange)
minus = fixnan(100 * ta.rma(minusDM, len) / truerange)
adx(dilen, adxlen) =>
= dirmov(dilen)
sum = plus + minus
adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)
adx
sig = adx(dilen, adxlen)
// range ADX threshold
sidewaysThreshold = input.int(title='ADX Sideways Threshold (10-30)', minval=2, defval=15)
// boolean expression to see if the ADX is below tehe sideways threshold
bool isSideways = sig < sidewaysThreshold
// adding the option to color the bars when in a trading range
useBarColor = true
bColor = isSideways ? color.new(#4b148d, 0) : na
barcolor(useBarColor ? bColor : na)
barcolor(close > supertrend ? #00e2ff : #fe0100)
// High Lows
y1 = low - (ta.atr(30) * 2), y1B = low - ta.atr(30)
y2 = high + (ta.atr(30) * 2), y2B = high + ta.atr(30)
bull = ta.crossover(close, supertrend) and close >= sma9
bear = ta.crossunder(close, supertrend) and close <= sma9
// Plots
windowsize = 100
offset = 0.9
sigma = 6
//plot(ta.alma(source, windowsize, offset, sigma))
windowsize2 = 310
offset2 = 0.85
sigma2 = 32
//plot(ta.alma(source, windowsize2, offset2, sigma2))
// Chart Features
smoothrng(x, t, m) =>
wper = t * 2 - 1
avrng = ta.ema(math.abs(x - x ), t)
smoothrng = ta.ema(avrng, wper) * m
smoothrng
smrng = smoothrng(close, 22, 6)
rngfilt(x, r) =>
rngfilt = x
rngfilt := x > nz(rngfilt ) ? x - r < nz(rngfilt ) ? nz(rngfilt ) : x - r : x + r > nz(rngfilt ) ? nz(rngfilt ) : x + r
rngfilt
filt = rngfilt(close, smrng)
// ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
upward = 0.0
upward := filt > filt ? nz(upward ) + 1 : filt < filt ? 0 : nz(upward )
downward = 0.0
downward := filt < filt ? nz(downward ) + 1 : filt > filt ? 0 : nz(downward )
filtcolor = upward > 0 ? color.new(#00e2ff, 50) : downward > 0 ? color.new(#fe0100, 50) : color.new(#56328f, 0)
plot(TrendFollower ? filt : na, color=filtcolor, linewidth=1, title='Trend Tracer')
// Trend Cloud
tclength = 600
hullma = ta.wma(2*ta.wma(close, tclength/2)-ta.wma(close, tclength), math.floor(math.sqrt(tclength)))
plot(LongTrendAverage ? hullma : na, 'Trend Cloud', linewidth=4, color=close > hullma ? color.new(#00e2ff, 65) : color.new(#fe0100, 65))
// Comulus Cloud
candle = ta.alma(source, windowsize2, offset2, sigma2)
reach = ta.alma(source, windowsize, offset, sigma)
candlep = plot(ShowComulus ? candle : na, color=color.new(color.white, 100))
reachp = plot(ShowComulus ? reach : na, color=color.new(color.white, 100))
fill(reachp, candlep, color= candle > reach ? color.new(#fe0100, 85) : color.new(#00e2ff, 85))
// Chart Features
x1 = 22
x2 = 9
x3 = 15
x4 = 5
smoothrngX1(x, t, m) =>
wper = t * 2 - 1
avrng = ta.ema(math.abs(x - x ), t)
smoothrngX1 = ta.ema(avrng, wper) * m
smoothrngX1
smrngx1x = smoothrngX1(close, x1, x2)
smrngx1x2 = smoothrngX1(close, x3, x4)
rngfiltx1x1(x, r) =>
rngfiltx1x1 = x
rngfiltx1x1 := x > nz(rngfiltx1x1 ) ? x - r < nz(rngfiltx1x1 ) ? nz(rngfiltx1x1 ) : x - r : x + r > nz(rngfiltx1x1 ) ? nz(rngfiltx1x1 ) : x + r
rngfiltx1x1
filtx1 = rngfiltx1x1(close, smrngx1x)
filtx12 = rngfiltx1x1(close, smrngx1x2)
// ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
upwardx1 = 0.0
upwardx1 := filtx1 > filtx1 ? nz(upwardx1 ) + 1 : filtx1 < filtx1 ? 0 : nz(upwardx1 )
downwardx1 = 0.0
downwardx1 := filtx1 < filtx1 ? nz(downwardx1 ) + 1 : filtx1 > filtx1 ? 0 : nz(downwardx1 )
filtx1colorx1 = color.rgb(0, 187, 212, 100)
xxx1 = plot(CirrusCloud ? filtx1 : na, color=filtx1colorx1, linewidth=1, title='Trend Tracer', editable = false)
xxx2 = plot(CirrusCloud ? filtx12 : na, color=filtx1colorx1, linewidth=1, title='Trend Tracer', editable = false)
fill(xxx1, xxx2, color= filtx1 > filtx12 ? color.new(#fe0100, 65) : color.new(#00e2ff, 65))
buy = bull and nbuysell ? label.new(bar_index, y1, sma4 >= sma5 ? "Strong Buy" : "Buy", xloc.bar_index, yloc.price, #00e2ff, label.style_label_up, color.white, size.normal) : na
sell = bear and nbuysell ? label.new(bar_index, y2, sma4 <= sma5 ? "Strong Sell" : "Sell", xloc.bar_index, yloc.price, #fe0100, label.style_label_down, color.white, size.normal) : na
// Other initializations
avg_volume = ta.sma(volume, 20)
very_weak_multiplier = 0.5
weak_multiplier = 1
strong_multiplier = 1.5
// Rejection handling
var int demandRejections = array.new_int(history_of_demand_to_keep, 0)
var int supplyRejections = array.new_int(history_of_demand_to_keep, 0)
var int demandCreationBars = array.new_int(history_of_demand_to_keep, na)
var int supplyCreationBars = array.new_int(history_of_demand_to_keep, na)
var box current_demand_box = array.new_box(history_of_demand_to_keep, na)
var box current_supply_box = array.new_box(history_of_demand_to_keep, na)
f_check_demand_rejections() =>
for i = 0 to history_of_demand_to_keep - 1
if not na(array.get(demandCreationBars, i))
if bar_index - array.get(demandCreationBars, i) > 15 and bar_index - array.get(demandCreationBars, i) % 15 == 0
label.new(bar_index, high, "Checking demand rejection", color=color.red)
dBox = array.get(current_demand_box, i)
if (na(dBox))
continue
withinBox = (high >= box.get_bottom(dBox) and high <= box.get_top(dBox)) or (close >= box.get_bottom(dBox) and close <= box.get_top(dBox))
bearishCandlesCount = math.sum(close < open ? 1 : 0, 15)
if withinBox and bearishCandlesCount >= 7
label.new(bar_index, low, "Bearish count > 7", color=color.blue)
array.set(demandRejections, i, array.get(demandRejections, i) + 1)
f_check_supply_rejections() =>
for i = 0 to history_of_demand_to_keep - 1
if not na(array.get(supplyCreationBars, i))
if bar_index - array.get(supplyCreationBars, i) > 15 and bar_index - array.get(supplyCreationBars, i) % 15 == 0
label.new(bar_index, low, "Checking supply rejection", color=color.red)
sBox = array.get(current_supply_box, i)
if (na(sBox))
continue
withinBox = (low <= box.get_top(sBox) and low >= box.get_bottom(sBox)) or (close <= box.get_top(sBox) and close >= box.get_bottom(sBox))
bullishCandlesCount = math.sum(close > open ? 1 : 0, 15)
if withinBox and bullishCandlesCount >= 7
label.new(bar_index, high, "Bullish count > 7", color=color.blue)
array.set(supplyRejections, i, array.get(supplyRejections, i) + 1)
f_array_add_pop(array, new_value_to_add) =>
array.unshift(array, new_value_to_add)
array.pop(array)
f_sh_sl_labels(array, swing_type) =>
var string label_text = na
if swing_type == 1
if array.get(array, 0) >= array.get(array, 1)
label_text := 'HH'
else
label_text := 'LH'
label.new(bar_index - swing_length, array.get(array,0), text = label_text, style=label.style_label_down, textcolor = color.white, color = color.new(color.white, 100), size = size.tiny)
else if swing_type == -1
if array.get(array, 0) >= array.get(array, 1)
label_text := 'HL'
else
label_text := 'LL'
label.new(bar_index - swing_length, array.get(array,0), text = label_text, style=label.style_label_up, textcolor = color.white, color = color.new(color.white, 100), size = size.tiny)
f_check_overlapping(new_poi, box_array, atr) =>
atr_threshold = atr * 2
okay_to_draw = true
for i = 0 to array.size(box_array) - 1
top = box.get_top(array.get(box_array, i))
bottom = box.get_bottom(array.get(box_array, i))
poi = (top + bottom) / 2
upper_boundary = poi + atr_threshold
lower_boundary = poi - atr_threshold
if new_poi >= lower_boundary and new_poi <= upper_boundary
okay_to_draw := false
break
else
okay_to_draw := true
okay_to_draw
f_supply_demand(value_array, bn_array, box_array, label_array, box_type, atr) =>
atr_buffer = atr * (box_width / 10)
box_left = array.get(bn_array, 0)
box_right = bar_index + 20
var float box_top = 0.00
var float box_bottom = 0.00
var float poi = 0.00
if box_type == 1
box_top := array.get(value_array, 0)
box_bottom := box_top - atr_buffer
poi := (box_top + box_bottom) / 2
else if box_type == -1
box_bottom := array.get(value_array, 0)
box_top := box_bottom + atr_buffer
poi := (box_top + box_bottom) / 2
okay_to_draw = f_check_overlapping(poi, box_array, atr)
swing_volume = volume
var string strength_text = ""
highest_volume_last_20 = ta.highest(volume, 20)
volume_percentage = math.round(swing_volume / highest_volume_last_20 * 100)
volume_percentage := math.min(volume_percentage, 100) // Cap the volume percentage to 100
var extend_option = extend.right
if box_extend_option == "Right"
extend_option := extend.right
else if box_extend_option == "Both"
extend_option := extend.both
if box_type == 1 and okay_to_draw and s1
box.delete( array.get(box_array, array.size(box_array) - 5) )
f_array_add_pop(box_array, box.new( left = box_left, top = box_top, right = box_right, bottom = box_bottom, border_color = color.rgb(242,54,69,50), border_width=1,
bgcolor = supply_color, extend = extend_option, text = strength_text, text_halign = text.align_right, text_valign = text.align_center, text_color = color.white, text_size = size.small, xloc = xloc.bar_index))
box.delete( array.get(label_array, array.size(label_array) - 5) )
f_array_add_pop(label_array, box.new( left = box_left, top = poi, right = box_right, bottom = poi, border_color = color.rgb(242,54,69,50), border_width=1, border_style=line.style_dotted,
bgcolor = color.new(color.black,100), extend = extend_option, text = '', text_halign = text.align_left, text_valign = text.align_center, text_color = color.white, text_size = size.small, xloc = xloc.bar_index))
else if box_type == -1 and okay_to_draw and s1
box.delete( array.get(box_array, array.size(box_array) - 5) )
f_array_add_pop(box_array, box.new( left = box_left, top = box_top, right = box_right, bottom = box_bottom, border_color = color.rgb(0,188,212,50), border_width=1,
bgcolor = demand_color, extend = extend_option, text = strength_text, text_halign = text.align_right, text_valign = text.align_center, text_color = color.white, text_size = size.small, xloc = xloc.bar_index))
box.delete( array.get(label_array, array.size(label_array) - 5) )
f_array_add_pop(label_array, box.new( left = box_left, top = poi, right = box_right, bottom = poi, border_color = color.rgb(0,188,212,50), border_width=1, border_style=line.style_dotted,
bgcolor = color.new(color.black,100), extend = extend_option, text = '', text_halign = text.align_left, text_valign = text.align_center, text_color = color.white, text_size = size.small, xloc = xloc.bar_index))
f_sd_to_bos(box_array, bos_array, label_array, zone_type) =>
if zone_type == 1
for i = 0 to array.size(box_array) - 1
level_to_break = box.get_top(array.get(box_array,i))
if close >= level_to_break
box.delete(array.get(box_array, i))
box.delete(array.get(label_array, i))
if zone_type == -1
for i = 0 to array.size(box_array) - 1
level_to_break = box.get_bottom(array.get(box_array,i))
if close <= level_to_break
box.delete(array.get(box_array, i))
box.delete(array.get(label_array, i))
f_extend_box_endpoint(box_array) =>
for i = 0 to array.size(box_array) - 1
box.set_right(array.get(box_array, i), bar_index + 30) // Extend only 20 bars
atr567 = ta.atr(50)
swing_high = ta.pivothigh(high, swing_length, swing_length)
swing_low = ta.pivotlow(low, swing_length, swing_length)
var swing_high_values = array.new_float(5,0.00)
var swing_low_values = array.new_float(5,0.00)
var swing_high_bns = array.new_int(5,0)
var swing_low_bns = array.new_int(5,0)
var current_supply_poi = array.new_box(history_of_demand_to_keep, na)
var current_demand_poi = array.new_box(history_of_demand_to_keep, na)
var supply_bos = array.new_box(5, na)
var demand_bos = array.new_box(5, na)
if not na(swing_high)
f_array_add_pop(swing_high_values, swing_high)
f_array_add_pop(swing_high_bns, bar_index )
if show_price_action_labels
f_sh_sl_labels(swing_high_values, 1)
f_supply_demand(swing_high_values, swing_high_bns, current_supply_box, current_supply_poi, 1, atr567)
else if not na(swing_low)
f_array_add_pop(swing_low_values, swing_low)
f_array_add_pop(swing_low_bns, bar_index )
if show_price_action_labels
f_sh_sl_labels(swing_low_values, -1)
f_supply_demand(swing_low_values, swing_low_bns, current_demand_box, current_demand_poi, -1, atr567)
f_sd_to_bos(current_supply_box, supply_bos, current_supply_poi, 1)
f_sd_to_bos(current_demand_box, demand_bos, current_demand_poi, -1)
f_extend_box_endpoint(current_supply_box)
f_extend_box_endpoint(current_demand_box)
// Inside the main execution, after the box is drawn, check for rejections
if not na(swing_low)
f_array_add_pop(swing_low_values, swing_low)
f_array_add_pop(swing_low_bns, bar_index )
if show_price_action_labels
f_sh_sl_labels(swing_low_values, -1)
f_supply_demand(swing_low_values, swing_low_bns, current_demand_box, current_demand_poi, -1, atr567)
f_check_demand_rejections()
if not na(swing_high)
f_array_add_pop(swing_high_values, swing_high)
f_array_add_pop(swing_high_bns, bar_index )
if show_price_action_labels
f_sh_sl_labels(swing_high_values, 1)
f_supply_demand(swing_high_values, swing_high_bns, current_supply_box, current_supply_poi, 1, atr567)
f_check_supply_rejections()
trigger2 = bull ? 1 : 0
countBull = ta.barssince(bull)
countBear = ta.barssince(bear)
trigger = nz(countBull, bar_index) < nz(countBear, bar_index) ? 1 : 0
atrBand = ta.atr(atrLen) * atrRisk
atrStop = trigger == 1 ? low - atrBand : high + atrBand
lastTrade(close) => ta.valuewhen(bull or bear , close, 0)
entry = levels ? label.new(time, close, "ENTRY " + str.tostring(lastTrade(close), decimals), xloc.bar_time, yloc.price, #00e2ff, label.style_label_left, color.white, size.normal) : na
label.set_x(entry, label.get_x(entry) + math.round(ta.change(time) * lvlDistance))
label.set_y(entry, lastTrade(close))
label.delete(entry )
stop_y = lastTrade(atrStop)
stop = levels ? label.new(time, close, "SL " + str.tostring(stop_y, decimals), xloc.bar_time, yloc.price, red2, label.style_label_left, color.white, size.normal) : na
label.set_x(stop, label.get_x(stop) + math.round(ta.change(time) * lvlDistance))
label.set_y(stop, stop_y)
label.delete(stop )
tp1Rl_y = (lastTrade(close)-lastTrade(atrStop))*1 + lastTrade(close)
tp1Rl = levels ? label.new(time, close, "1:1 TP " + str.tostring(tp1Rl_y, decimals), xloc.bar_time, yloc.price, green2, label.style_label_left, color.white, size.normal ) : na
label.set_x(tp1Rl, label.get_x(tp1Rl) + math.round(ta.change(time) * lvlDistance))
label.set_y(tp1Rl, tp1Rl_y)
label.delete(tp1Rl )
tp2RL_y = (lastTrade(close)-lastTrade(atrStop))*2 + lastTrade(close)
tp2RL = levels ? label.new(time, close, "2:1 TP " + str.tostring(tp2RL_y, decimals), xloc.bar_time, yloc.price, green2, label.style_label_left, color.white, size.normal) : na
label.set_x(tp2RL, label.get_x(tp2RL) + math.round(ta.change(time) * lvlDistance))
label.set_y(tp2RL, tp2RL_y)
label.delete(tp2RL )
tp3RL_y = (lastTrade(close)-lastTrade(atrStop))*3 + lastTrade(close)
tp3RL = levels ? label.new(time, close, "3:1 TP " + str.tostring(tp3RL_y, decimals), xloc.bar_time, yloc.price, green2, label.style_label_left, color.white, size.normal) : na
label.set_x(tp3RL, label.get_x(tp3RL) + math.round(ta.change(time) * lvlDistance))
label.set_y(tp3RL, tp3RL_y)
label.delete(tp3RL )
style = linesStyle == "SOLID" ? line.style_solid : linesStyle == "DASHED" ? line.style_dashed : line.style_dotted
lineEntry = levels and lvlLines ? line.new(bar_index - (trigger == 0 ? countBull : countBear), lastTrade(close), bar_index + lvlDistance, lastTrade(close), xloc.bar_index, extend.none, #00e2ff, style, 2) : na, line.delete(lineEntry )
lineStop = levels and lvlLines ? line.new(bar_index - (trigger == 0 ? countBull : countBear), stop_y, bar_index + lvlDistance, stop_y, xloc.bar_index, extend.none, #fe0100, style, 2) : na, line.delete(lineStop )
lineTp1Rl = levels and lvlLines ? line.new(bar_index - (trigger == 0 ? countBull : countBear), tp1Rl_y, bar_index + lvlDistance, tp1Rl_y, xloc.bar_index, extend.none, green2, style, 2) : na, line.delete(lineTp1Rl )
lineTp2RL = levels and lvlLines ? line.new(bar_index - (trigger == 0 ? countBull : countBear), tp2RL_y, bar_index + lvlDistance, tp2RL_y, xloc.bar_index, extend.none, green2, style, 2) : na, line.delete(lineTp2RL )
lineTp3RL = levels and lvlLines ? line.new(bar_index - (trigger == 0 ? countBull : countBear), tp3RL_y, bar_index + lvlDistance, tp3RL_y, xloc.bar_index, extend.none, green2, style, 2) : na, line.delete(lineTp3RL )
alertcondition(bull, title='Buy Signal', message = "BUY")
alertcondition(bear, title='Buy Signal', message = "BUY")
//import protradingart/pta_plot/6 as pp
//pp.peakprofit(bull, bear)
عيدالله
//@version=5
indicator("استراتيجية تقاطع المتوسط المتحرك على فريم 5 دقائق", overlay=true)
// إعدادات المتوسطات المتحركة
shortLength = input(9, title="طول المتوسط المتحرك القصير")
longLength = input(21, title="طول المتوسط المتحرك الطويل")
// حساب المتوسطات المتحركة
shortSMA = ta.sma(close, shortLength)
longSMA = ta.sma(close, longLength)
// رسم المتوسطات المتحركة على الشارت
plot(shortSMA, color=color.blue, title="المتوسط المتحرك القصير")
plot(longSMA, color=color.red, title="المتوسط المتحرك الطويل")
// شروط الدخول والخروج
longCondition = ta.crossover(shortSMA, longSMA) // تقاطع صعودي (شراء)
shortCondition = ta.crossunder(shortSMA, longSMA) // تقاطع هبوطي (بيع)
// تنفيذ أوامر الدخول
if (longCondition)
strategy.entry("شراء", strategy.long)
if (shortCondition)
strategy.entry("بيع", strategy.short)
// إعدادات الخروج
strategy.close("شراء", when=shortCondition)
strategy.close("بيع", when=longCondition)
Its5//@version=5
indicator("HMA Trend Signal", overlay=true)
// Parameters
length = input.int(21, title="HMA Length")
// Calculate the Hull Moving Average
wma1 = ta.wma(close, length)
wma2 = ta.wma(close, length / 2)
hma = ta.wma(2 * wma2 - wma1, math.round(math.sqrt(length)))
// Define conditions for buy and sell signals
buySignal = ta.crossover(close, hma)
sellSignal = ta.crossunder(close, hma)
// Plot the Hull Moving Average
plot(hma, color=color.blue, title="HMA")
// Plot signals
plotshape(buySignal, color=color.green, style=shape.labelup, location=location.belowbar, text="BUY", size=size.small)
plotshape(sellSignal, color=color.red, style=shape.labeldown, location=location.abovebar, text="SELL", size=size.small)
Its5//@version=5
indicator("HMA Trend Signal", overlay=true)
// Parameters
length = input.int(21, title="HMA Length")
// Calculate the Hull Moving Average
wma1 = ta.wma(close, length)
wma2 = ta.wma(close, length / 2)
hma = ta.wma(2 * wma2 - wma1, math.round(math.sqrt(length)))
// Define conditions for buy and sell signals
buySignal = ta.crossover(close, hma)
sellSignal = ta.crossunder(close, hma)
// Plot the Hull Moving Average
plot(hma, color=color.blue, title="HMA")
// Plot signals
plotshape(buySignal, color=color.green, style=shape.labelup, location=location.belowbar, text="BUY", size=size.small)
plotshape(sellSignal, color=color.red, style=shape.labeldown, location=location.abovebar, text="SELL", size=size.small)
gold//@version=5
strategy("استراتيجية فيبو ناتجي", overlay=true)
// حدد المتغيرات والإعدادات الأساسية
startBar = input(1, "البار الأول للحساب", minval=1)
endBar = input(10, "البار الأخير للحساب", minval=1)
fibLevels = input( , "مستويات الفيبوناتشي")
// حساب نقاط الفيبوناتشي
fibHigh = request.security(syminfo.tickerid, "D", request.high )
fibLow = request.security(syminfo.tickerid, "D", request.low )
fibRange = fibHigh - fibLow
fibPoints = fibLow + (fibLevels / 2) * fibRange
// رسم المستويات على الرسم البياني
for i = 0 to array.size(fibPoints) - 1
line.new(x1=startBar, y1=fibPoints , x2=endBar, y2=fibPoints , color=color.blue, width=1)
// تقاطع الأسعار مع مستويات الفيبوناتشي
for i = 0 to array.size(fibPoints) - 1
if ta.crossover(request.close, fibPoints )
strategy.entry("شراء", strategy.long)
if ta.crossunder(request.close, fibPoints )
strategy.close("شراء")
// إخراج النتائج
plot(request.close, "السعر", color=color.black, linewidth=1, style=plot.style_circles)
Sltenzi//DRBASL
//@version=5
indicator("Quantitative Market Analyst KSA ksa", overlay=true, max_lines_count=500, max_boxes_count=100)
// الإعدادات
show_summary = input.bool(true, "إظهار الملخص", group="العرض")
show_oscillators = input.bool(true, "إظهار المؤشرات الفنية", group="العرض")
show_moving_averages = input.bool(true, "إظهار المتوسطات المتحركة", group="العرض")
show_ob_analysis = input.bool(true, "إظهار تحليل الكتل السعرية", group="العرض")
show_supertrend = input.bool(true, "إظهار تحليل سوبرترند", group="العرض")
show_trendline = input.bool(true, "إظهار تحليل الترند/القناة", group="العرض")
show_volume = input.bool(true, "إظهار تحليل الحجم", group="العرض")
show_progress_bars = input.bool(true, "إظهار مؤشرات التقدم", group="العرض")
dashboard_size = input.string("عادي", "حجم لوحة المعلومات", options= , group="العرض")
theme_setting = input.string("مضيء", "الثيم", options= , group="العرض")
timeframe_setting = input.timeframe("60", "الإطار الزمني للتحليل", group="الإعدادات")
// إعدادات الكتل السعرية
ob_lookback = input.int(50, "فترة البحث عن الكتل", minval=10, maxval=200, group="الكتل السعرية")
ob_min_touches = input.int(2, "أقل عدد لمسات للكتلة", minval=1, maxval=5, group="الكتل السعرية")
// إعدادات سوبرترند
atr_period = input.int(10, "فترة ATR", group="سوبرترند")
atr_multiplier = input.float(6.0, "مضاعف ATR", step=0.1, group="سوبرترند")
// إعدادات الترند/القناة
trendline_lookback = input.int(100, "فترة الترند", minval=20, maxval=500, group="الترند")
channel_width_multiplier = input.float(2.0, "مضاعف عرض القناة", step=0.1, group="الترند")
// إعدادات الحجم
volume_ma_period = input.int(20, "فترة متوسط الحجم", group="الحجم")
volume_threshold = input.float(1.5, "عتبة ارتفاع الحجم", step=0.1, group="الحجم")
// ألوان الثيم المضيء
light_bg_primary = color.new(color.white, 5)
light_bg_secondary = color.new(#f8f9fa, 0)
light_royal_blue = color.new(#4169e1, 0)
light_royal_blue_light = color.new(#6495ed, 0)
light_border_color = color.new(#e1e5e9, 0)
light_text_primary = color.new(#2c3e50, 0)
light_text_secondary = color.new(#5a6c7d, 0)
// ألوان الثيم الداكن
dark_bg_primary = color.new(#1e1e1e, 5)
dark_bg_secondary = color.new(#2d2d2d, 0)
dark_royal_blue = color.new(#5a9fd4, 0)
dark_royal_blue_light = color.new(#4a8cc7, 0)
dark_border_color = color.new(#404040, 0)
dark_text_primary = color.new(#e8e8e8, 0)
dark_text_secondary = color.new(#b8b8b8, 0)
// اختيار ألوان الثيم
bg_primary = theme_setting == "مضيء" ? light_bg_primary : dark_bg_primary
bg_secondary = theme_setting == "مضيء" ? light_bg_secondary : dark_bg_secondary
royal_blue = theme_setting == "مضيء" ? light_royal_blue : dark_royal_blue
royal_blue_light = theme_setting == "مضيء" ? light_royal_blue_light : dark_royal_blue_light
border_color = theme_setting == "مضيء" ? light_border_color : dark_border_color
text_primary = theme_setting == "مضيء" ? light_text_primary : dark_text_primary
text_secondary = theme_setting == "مضيء" ? light_text_secondary : dark_text_secondary
// ألوان الإشارات - موحدة لكلا الثيمين
strong_buy_color = color.new(#00c851, 0)
buy_color = color.new(#28a745, 0)
neutral_color = color.new(#6c757d, 0)
sell_color = color.new(#dc3545, 0)
strong_sell_color = color.new(#c62828, 0)
// ألوان مؤشرات التقدم
progress_bg = theme_setting == "مضيء" ? color.new(#e9ecef, 0) : color.new(#404040, 0)
progress_positive = color.new(#28a745, 0)
progress_negative = color.new(#dc3545, 0)
// المؤشرات الفنية
rsi = request.security(syminfo.tickerid, timeframe_setting, ta.rsi(close, 14))
stoch_k = request.security(syminfo.tickerid, timeframe_setting, ta.stoch(close, high, low, 14))
cci = request.security(syminfo.tickerid, timeframe_setting, ta.cci(close, 20))
williams_r = request.security(syminfo.tickerid, timeframe_setting, ta.wpr(14))
= request.security(syminfo.tickerid, timeframe_setting, ta.macd(close, 12, 26, 9))
momentum = request.security(syminfo.tickerid, timeframe_setting, ta.mom(close, 10))
roc = request.security(syminfo.tickerid, timeframe_setting, ta.roc(close, 9))
= request.security(syminfo.tickerid, timeframe_setting, ta.bb(close, 20, 2))
// المتوسطات المتحركة
sma10 = request.security(syminfo.tickerid, timeframe_setting, ta.sma(close, 10))
sma20 = request.security(syminfo.tickerid, timeframe_setting, ta.sma(close, 20))
sma50 = request.security(syminfo.tickerid, timeframe_setting, ta.sma(close, 50))
sma100 = request.security(syminfo.tickerid, timeframe_setting, ta.sma(close, 100))
sma200 = request.security(syminfo.tickerid, timeframe_setting, ta.sma(close, 200))
ema10 = request.security(syminfo.tickerid, timeframe_setting, ta.ema(close, 10))
ema20 = request.security(syminfo.tickerid, timeframe_setting, ta.ema(close, 20))
ema50 = request.security(syminfo.tickerid, timeframe_setting, ta.ema(close, 50))
current_price = request.security(syminfo.tickerid, timeframe_setting, close)
// كشف الكتل السعرية
detect_order_blocks() =>
var float bullish_ob_level = na
var float bearish_ob_level = na
var int bullish_ob_strength = 0
var int bearish_ob_strength = 0
// كتلة دعم صاعدة
for i = 1 to ob_lookback
if i < bar_index
if low < low and low < low and high > high
potential_ob = low
touches = 0
for j = 0 to i-1
if low <= potential_ob * 1.002 and low >= potential_ob * 0.998
touches += 1
if touches >= ob_min_touches
bullish_ob_level := potential_ob
bullish_ob_strength := touches
break
// كتلة مقاومة هابطة
for i = 1 to ob_lookback
if i < bar_index
if high > high and high > high and low < low
potential_ob = high
touches = 0
for j = 0 to i-1
if high >= potential_ob * 0.998 and high <= potential_ob * 1.002
touches += 1
if touches >= ob_min_touches
bearish_ob_level := potential_ob
bearish_ob_strength := touches
break
// كشف الاختراق
bullish_breakout = not na(bearish_ob_level) and close > bearish_ob_level and close <= bearish_ob_level
bearish_breakout = not na(bullish_ob_level) and close < bullish_ob_level and close >= bullish_ob_level
ob_signal = bullish_breakout ? 2 : bearish_breakout ? -2 : close > bullish_ob_level ? 1 : close < bearish_ob_level ? -1 : 0
// حساب سوبرترند
calculate_supertrend() =>
= request.security(syminfo.tickerid, timeframe_setting, ta.supertrend(atr_multiplier, atr_period))
st_signal = direction == -1 ? 2 : direction == 1 ? -2 : 0
st_signal
// تحليل الترند/القناة
calculate_trendline_channel() =>
var line upper_trendline = na
var line lower_trendline = na
var float upper_slope = 0.0
var float lower_slope = 0.0
pivot_high = ta.pivothigh(high, 5, 5)
pivot_low = ta.pivotlow(low, 5, 5)
highs = array.new_float(0)
lows = array.new_float(0)
for i = 0 to math.min(trendline_lookback, bar_index)
if high == ta.highest(high, 11)
array.push(highs, high )
if low == ta.lowest(low, 11)
array.push(lows, low )
upper_trend = ta.highest(high, trendline_lookback)
lower_trend = ta.lowest(low, trendline_lookback)
mid_trend = (upper_trend + lower_trend) / 2
channel_width = (upper_trend - lower_trend) * channel_width_multiplier
upper_channel = mid_trend + channel_width / 2
lower_channel = mid_trend - channel_width / 2
trendline_signal = close > upper_channel ? 2 : close < lower_channel ? -2 : close > mid_trend ? 1 : close < mid_trend ? -1 : 0
trendline_signal
// تحليل الحجم
calculate_volume_analysis() =>
vol = request.security(syminfo.tickerid, timeframe_setting, volume)
vol_ma = request.security(syminfo.tickerid, timeframe_setting, ta.sma(volume, volume_ma_period))
volume_ratio = vol / vol_ma
is_volume_spike = volume_ratio > volume_threshold
obv = request.security(syminfo.tickerid, timeframe_setting, ta.obv)
obv_ma = request.security(syminfo.tickerid, timeframe_setting, ta.sma(ta.obv, 20))
vpt = request.security(syminfo.tickerid, timeframe_setting, ta.cum((close - close ) / close * volume))
vpt_ma = request.security(syminfo.tickerid, timeframe_setting, ta.sma(ta.cum((close - close ) / close * volume), 20))
mfi = request.security(syminfo.tickerid, timeframe_setting, ta.mfi(hlc3, 14))
ad = request.security(syminfo.tickerid, timeframe_setting, ta.cum(((close - low) - (high - close)) / (high - low) * volume))
ad_ma = request.security(syminfo.tickerid, timeframe_setting, ta.sma(ta.cum(((close - low) - (high - close)) / (high - low) * volume), 20))
volume_signal = 0
volume_signal += is_volume_spike and close > close ? 2 : is_volume_spike and close < close ? -2 : 0
volume_signal += obv > obv_ma ? 1 : obv < obv_ma ? -1 : 0
volume_signal += vpt > vpt_ma ? 1 : vpt < vpt_ma ? -1 : 0
volume_signal += mfi > 70 ? -1 : mfi < 30 ? 1 : 0
volume_signal += ad > ad_ma ? 1 : ad < ad_ma ? -1 : 0
volume_signal
// حساب المؤشرات الجديدة
= detect_order_blocks()
st_signal = calculate_supertrend()
trendline_signal = calculate_trendline_channel()
volume_signal = calculate_volume_analysis()
// دوال تقييم الإشارات
get_oscillator_signal(value, overbought, oversold) =>
value > overbought ? -2 : value > (overbought + oversold) / 2 ? -1 : value < oversold ? 2 : value < (overbought + oversold) / 2 ? 1 : 0
get_ma_signal(price, ma_value) =>
if not na(ma_value) and ma_value != 0
diff_pct = (price - ma_value) / ma_value * 100
diff_pct > 2 ? 2 : diff_pct > 0 ? 1 : diff_pct < -2 ? -2 : diff_pct < 0 ? -1 : 0
else
0
// حساب الإشارات
rsi_signal = get_oscillator_signal(rsi, 70, 30)
stoch_signal = get_oscillator_signal(stoch_k, 80, 20)
cci_signal = get_oscillator_signal(cci, 100, -100)
williams_signal = get_oscillator_signal(williams_r, -20, -80)
macd_signal = macd_line > signal_line ? 1 : macd_line < signal_line ? -1 : 0
momentum_signal = momentum > 0 ? 1 : momentum < 0 ? -1 : 0
roc_signal = roc > 2 ? 1 : roc < -2 ? -1 : 0
bb_signal = current_price > bb_upper ? -1 : current_price < bb_lower ? 1 : 0
sma10_signal = get_ma_signal(current_price, sma10)
sma20_signal = get_ma_signal(current_price, sma20)
sma50_signal = get_ma_signal(current_price, sma50)
sma100_signal = get_ma_signal(current_price, sma100)
sma200_signal = get_ma_signal(current_price, sma200)
ema10_signal = get_ma_signal(current_price, ema10)
ema20_signal = get_ma_signal(current_price, ema20)
ema50_signal = get_ma_signal(current_price, ema50)
// تجميع الإشارات
oscillator_total = rsi_signal + stoch_signal + cci_signal + williams_signal + macd_signal + momentum_signal + roc_signal + bb_signal
ma_total = sma10_signal + sma20_signal + sma50_signal + sma100_signal + sma200_signal + ema10_signal + ema20_signal + ema50_signal
advanced_total = ob_signal + st_signal + trendline_signal + volume_signal
// حساب الإجمالي الكلي
overall_total = oscillator_total + ma_total + advanced_total
// دوال حجم النص حسب حجم اللوحة
get_header_size() =>
dashboard_size == "صغير" ? size.small : dashboard_size == "عادي" ? size.normal : dashboard_size == "كبير" ? size.large : dashboard_size == "كبير جداً" ? size.huge : size.normal
get_main_text_size() =>
dashboard_size == "صغير" ? size.tiny : dashboard_size == "عادي" ? size.normal : dashboard_size == "كبير" ? size.large : dashboard_size == "كبير جداً" ? size.huge : size.normal
get_secondary_text_size() =>
dashboard_size == "صغير" ? size.tiny : dashboard_size == "عادي" ? size.small : dashboard_size == "كبير" ? size.normal : dashboard_size == "كبير جداً" ? size.large : size.small
get_progress_size() =>
dashboard_size == "صغير" ? size.tiny : dashboard_size == "عادي" ? size.tiny : dashboard_size == "كبير" ? size.small : dashboard_size == "كبير جداً" ? size.normal : size.tiny
// دالة ترجمة الإشارة
get_signal_text_and_color(total, threshold_strong_buy, threshold_buy, threshold_sell, threshold_strong_sell) =>
signal_txt = ""
signal_col = neutral_color
if total >= threshold_strong_buy
signal_txt := "شراء قوي"
signal_col := strong_buy_color
else if total >= threshold_buy
signal_txt := "شراء"
signal_col := buy_color
else if total >= threshold_sell and total <= -threshold_sell
signal_txt := "محايد"
signal_col := neutral_color
else if total >= threshold_strong_sell
signal_txt := "بيع"
signal_col := sell_color
else
signal_txt := "بيع قوي"
signal_col := strong_sell_color
// دالة شريط التقدم
create_progress_bar(value, max_value) =>
if max_value == 0
"▱▱▱▱▱▱▱▱▱▱"
else
filled_bars = math.round(math.abs(value) / max_value * 10)
filled_bars := math.min(filled_bars, 10)
progress_str = ""
for i = 1 to 10
progress_str := progress_str + (i <= filled_bars ? "▰" : "▱")
progress_str
// دالة عد إشارات الشراء/البيع
count_buy_sell_signals(total, max_signals) =>
buy_count = 0
sell_count = 0
neutral_count = 0
if total > 0
buy_count := math.min(total, max_signals)
else if total < 0
sell_count := math.min(math.abs(total), max_signals)
remaining = max_signals - buy_count - sell_count
neutral_count := math.max(0, remaining)
// رسم الجدول بالعربية
if barstate.islast
rows = 6
columns = 0
if show_summary
columns += 1
if show_oscillators
columns += 1
if show_moving_averages
columns += 1
if show_ob_analysis
columns += 1
if show_supertrend
columns += 1
if show_trendline
columns += 1
if show_volume
columns += 1
if columns > 0
var table dashboard = table.new(position.bottom_center, columns, rows, bgcolor=bg_primary, border_width=2, border_color=royal_blue)
table.clear(dashboard, 0, 0, columns - 1, rows - 1)
theme_indicator = theme_setting == "مضيء" ? "☀️" : "🌙"
header_text = theme_indicator + " محلل السوق الكمي DR-KSA | " + syminfo.ticker + " | بيانات مباشرة " + theme_indicator
table.cell(dashboard, 0, 0, header_text, text_color=color.white, bgcolor=royal_blue, text_size=get_header_size())
table.merge_cells(dashboard, 0, 0, columns - 1, 0)
current_col = 0
// الملخص
if show_summary
max_signals = 20
= get_signal_text_and_color(overall_total, 10, 4, -4, -10)
= count_buy_sell_signals(overall_total, max_signals)
table.cell(dashboard, current_col, 1, "الملخص", text_color=color.white, bgcolor=royal_blue_light, text_size=get_secondary_text_size())
table.cell(dashboard, current_col, 2, summary_text, text_color=summary_color, bgcolor=bg_secondary, text_size=get_main_text_size())
if show_progress_bars
progress_bar = create_progress_bar(overall_total, max_signals)
table.cell(dashboard, current_col, 3, progress_bar, text_color=summary_color, bgcolor=bg_secondary, text_size=get_progress_size())
else
table.cell(dashboard, current_col, 3, "", bgcolor=bg_secondary)
buy_text = "شراء: " + str.tostring(summary_buy)
neutral_text = "محايد: " + str.tostring(summary_neutral)
sell_text = "بيع: " + str.tostring(summary_sell)
table.cell(dashboard, current_col, 4, buy_text, text_color=buy_color, bgcolor=bg_secondary, text_size=get_secondary_text_size())
table.cell(dashboard, current_col, 5, neutral_text + " | " + sell_text, text_color=text_secondary, bgcolor=bg_secondary, text_size=get_secondary_text_size())
current_col += 1
// المؤشرات الفنية
if show_oscillators
= get_signal_text_and_color(oscillator_total, 6, 2, -2, -6)
= count_buy_sell_signals(oscillator_total, 8)
table.cell(dashboard, current_col, 1, "المؤشرات الفنية", text_color=color.white, bgcolor=royal_blue_light, text_size=get_secondary_text_size())
table.cell(dashboard, current_col, 2, osc_text, text_color=osc_color, bgcolor=bg_secondary, text_size=get_main_text_size())
if show_progress_bars
osc_progress = create_progress_bar(oscillator_total, 8)
table.cell(dashboard, current_col, 3, osc_progress, text_color=osc_color, bgcolor=bg_secondary, text_size=get_progress_size())
else
table.cell(dashboard, current_col, 3, "", bgcolor=bg_secondary)
osc_buy_text = "شراء: " + str.tostring(osc_buy)
osc_neutral_text = "محايد: " + str.tostring(osc_neutral)
osc_sell_text = "بيع: " + str.tostring(osc_sell)
table.cell(dashboard, current_col, 4, osc_buy_text, text_color=buy_color, bgcolor=bg_secondary, text_size=get_secondary_text_size())
table.cell(dashboard, current_col, 5, osc_neutral_text + " | " + osc_sell_text, text_color=text_secondary, bgcolor=bg_secondary, text_size=get_secondary_text_size())
current_col += 1
// المتوسطات المتحركة
if show_moving_averages
= get_signal_text_and_color(ma_total, 6, 2, -2, -6)
= count_buy_sell_signals(ma_total, 8)
table.cell(dashboard, current_col, 1, "المتوسطات المتحركة", text_color=color.white, bgcolor=royal_blue_light, text_size=get_secondary_text_size())
table.cell(dashboard, current_col, 2, ma_text, text_color=ma_color, bgcolor=bg_secondary, text_size=get_main_text_size())
if show_progress_bars
ma_progress = create_progress_bar(ma_total, 8)
table.cell(dashboard, current_col, 3, ma_progress, text_color=ma_color, bgcolor=bg_secondary, text_size=get_progress_size())
else
table.cell(dashboard, current_col, 3, "", bgcolor=bg_secondary)
ma_buy_text = "شراء: " + str.tostring(ma_buy)
ma_neutral_text = "محايد: " + str.tostring(ma_neutral)
ma_sell_text = "بيع: " + str.tostring(ma_sell)
table.cell(dashboard, current_col, 4, ma_buy_text, text_color=buy_color, bgcolor=bg_secondary, text_size=get_secondary_text_size())
table.cell(dashboard, current_col, 5, ma_neutral_text + " | " + ma_sell_text, text_color=text_secondary, bgcolor=bg_secondary, text_size=get_secondary_text_size())
current_col += 1
// الكتل السعرية
if show_ob_analysis
ob_text = ob_signal == 2 ? "اختراق صاعد" : ob_signal == -2 ? "اختراق هابط" : ob_signal == 1 ? "فوق الدعم" : ob_signal == -1 ? "تحت المقاومة" : "محايد"
ob_color = ob_signal >= 1 ? buy_color : ob_signal <= -1 ? sell_color : neutral_color
table.cell(dashboard, current_col, 1, "الكتل السعرية", text_color=color.white, bgcolor=royal_blue_light, text_size=get_secondary_text_size())
table.cell(dashboard, current_col, 2, ob_text, text_color=ob_color, bgcolor=bg_secondary, text_size=get_main_text_size())
if show_progress_bars
ob_progress = create_progress_bar(ob_signal, 2)
table.cell(dashboard, current_col, 3, ob_progress, text_color=ob_color, bgcolor=bg_secondary, text_size=get_progress_size())
else
table.cell(dashboard, current_col, 3, "", bgcolor=bg_secondary)
ob_level_text = not na(bullish_ob) ? "دعم: " + str.tostring(bullish_ob, "#.##") : "دعم: غير متوفر"
ob_resist_text = not na(bearish_ob) ? "مقاومة: " + str.tostring(bearish_ob, "#.##") : "مقاومة: غير متوفر"
table.cell(dashboard, current_col, 4, ob_level_text, text_color=text_secondary, bgcolor=bg_secondary, text_size=get_secondary_text_size())
table.cell(dashboard, current_col, 5, ob_resist_text, text_color=text_secondary, bgcolor=bg_secondary, text_size=get_secondary_text_size())
current_col += 1
// سوبرترند
if show_supertrend
st_text = st_signal == 2 ? "اتجاه صاعد" : st_signal == -2 ? "اتجاه هابط" : "محايد"
st_color = st_signal == 2 ? buy_color : st_signal == -2 ? sell_color : neutral_color
table.cell(dashboard, current_col, 1, "سوبرترند", text_color=color.white, bgcolor=royal_blue_light, text_size=get_secondary_text_size())
table.cell(dashboard, current_col, 2, st_text, text_color=st_color, bgcolor=bg_secondary, text_size=get_main_text_size())
if show_progress_bars
st_progress = create_progress_bar(st_signal, 2)
table.cell(dashboard, current_col, 3, st_progress, text_color=st_color, bgcolor=bg_secondary, text_size=get_progress_size())
else
table.cell(dashboard, current_col, 3, "", bgcolor=bg_secondary)
st_period_text = "فترة ATR: " + str.tostring(atr_period)
st_mult_text = "المضاعف: " + str.tostring(atr_multiplier)
table.cell(dashboard, current_col, 4, st_period_text, text_color=text_secondary, bgcolor=bg_secondary, text_size=get_secondary_text_size())
table.cell(dashboard, current_col, 5, st_mult_text, text_color=text_secondary, bgcolor=bg_secondary, text_size=get_secondary_text_size())
current_col += 1
// الترند/القناة
if show_trendline
tl_text = trendline_signal == 2 ? "اختراق علوي" : trendline_signal == -2 ? "اختراق سفلي" : trendline_signal == 1 ? "فوق المتوسط" : trendline_signal == -1 ? "تحت المتوسط" : "محايد"
tl_color = trendline_signal >= 1 ? buy_color : trendline_signal <= -1 ? sell_color : neutral_color
table.cell(dashboard, current_col, 1, "الترند/القناة", text_color=color.white, bgcolor=royal_blue_light, text_size=get_secondary_text_size())
table.cell(dashboard, current_col, 2, tl_text, text_color=tl_color, bgcolor=bg_secondary, text_size=get_main_text_size())
if show_progress_bars
tl_progress = create_progress_bar(trendline_signal, 2)
table.cell(dashboard, current_col, 3, tl_progress, text_color=tl_color, bgcolor=bg_secondary, text_size=get_progress_size())
else
table.cell(dashboard, current_col, 3, "", bgcolor=bg_secondary)
tl_lookback_text = "الفترة: " + str.tostring(trendline_lookback)
tl_width_text = "العرض: " + str.tostring(channel_width_multiplier)
table.cell(dashboard, current_col, 4, tl_lookback_text, text_color=text_secondary, bgcolor=bg_secondary, text_size=get_secondary_text_size())
table.cell(dashboard, current_col, 5, tl_width_text, text_color=text_secondary, bgcolor=bg_secondary, text_size=get_secondary_text_size())
current_col += 1
// الحجم
if show_volume
vol_text = volume_signal >= 3 ? "تجميع عالي" : volume_signal >= 1 ? "تجميع" : volume_signal <= -3 ? "توزيع عالي" : volume_signal <= -1 ? "توزيع" : "محايد"
vol_color = volume_signal >= 1 ? buy_color : volume_signal <= -1 ? sell_color : neutral_color
table.cell(dashboard, current_col, 1, "الحجم", text_color=color.white, bgcolor=royal_blue_light, text_size=get_secondary_text_size())
table.cell(dashboard, current_col, 2, vol_text, text_color=vol_color, bgcolor=bg_secondary, text_size=get_main_text_size())
if show_progress_bars
vol_progress = create_progress_bar(volume_signal, 5)
table.cell(dashboard, current_col, 3, vol_progress, text_color=vol_color, bgcolor=bg_secondary, text_size=get_progress_size())
else
table.cell(dashboard, current_col, 3, "", bgcolor=bg_secondary)
vol_ma_text = "متوسط الحجم: " + str.tostring(volume_ma_period)
vol_threshold_text = "عتبة الارتفاع: " + str.tostring(volume_threshold) + "x"
table.cell(dashboard, current_col, 4, vol_ma_text, text_color=text_secondary, bgcolor=bg_secondary, text_size=get_secondary_text_size())
table.cell(dashboard, current_col, 5, vol_threshold_text, text_color=text_secondary, bgcolor=bg_secondary, text_size=get_secondary_text_size())
plot(na)
Hhhhيمكنك استخدام الكود التالي لبرمجة مؤشر Demarker في "تريدينج فيو" باستخدام Pine Script. هذا الكود يقوم بإعطاء إشارة شراء عند إغلاق الشمعة أسفل مستوى 0.20 وإشارة بيع عند إغلاق الشمعة فوق مستوى 0.80.
```pinescript
//@version=5
indicator("Demarker Signal", overlay=false)
// إعدادات مؤشر Demarker
length = input(14, title="Length")
demarker = ta.demarker(length)
// مستويات الإشارات
buyLevel = 0.20
sellLevel = 0.80
// حساب إشارات الشراء والبيع
buySignal = ta.crossover(demarker, buyLevel)
sellSignal = ta.crossunder(demarker, sellLevel)
// رسم المؤشر
hline(buyLevel, "Buy Level", color=color.green)
hline(sellLevel, "Sell Level", color=color.red)
plot(demarker, title="Demarker", color=color.blue)
// إضافة إشارات الشراء والبيع على الرسم البياني
plotshape(buySignal, style=shape.labelup, location=location.belowbar, color=color.green, size=size.small, text="BUY")
plotshape(sellSignal, style=shape.labeldown, location=location.abovebar, color=color.red, size=size.small, text="SELL")
```
### كيفية استخدام الكود:
1. افتح "Pine Editor" في "تريدينج فيو".
2. انسخ الكود أعلاه والصقه في المحرر.
3. انقر على "Save" ثم "Add to Chart" لإضافة المؤشر إلى الرسم البياني.
سيظهر لك الآن مؤشر Demarker مع إشارات الشراء والبيع بناءً على المستويات المحددة. يمكنك تعديل طول المؤشر إذا كنت ترغب في ذلك.
نظرة فنية على تاسى يتحرك مؤشر "تاسي" حاليًا ضمن اتجاه هابط على المدى اللحظي داخل قناة سعرية هابطة واضحة. خلال جلسة الأمس، لاحظنا محاولة المؤشر التماسك عند الحد السفلي للقناة بالقرب من مستويات 11,950 نقطة، وهي منطقة دعم محورية تتقاطع مع مستوى تصحيح فيبوناتشي 38.2% للموجة الصعودية الأخيرة على الإطار الزمني اليومي. بالإضافة إلى ذلك، نجد أن مستويات 11,900 نقطة تتزامن مع امتداد فيبوناتشي 161.8% للحركة التصحيحية اللحظية، مما يعزز أهميتها كمنطقة دعم قوية.
على المدى القريب، يُتوقع أن يشهد المؤشر ارتدادًا صعوديًا في حال استمراره بالتماسك فوق نطاق الدعم الرئيسي الممتد بين 11,900 و11,950 نقطة. هذا الارتداد قد يدفع المؤشر نحو مستويات 12,000 نقطة كهدف أولي، مع احتمال مواصلة الصعود نحو مستويات 12,350 نقطة، والتي تُعد مستوى مقاومة رئيسيًا. اختراق هذا المستوى سيشكل إشارة إيجابية مبدئية لعودة الزخم الصعودي القوي، فيما سيكون الإغلاق فوق مستوى المقاومة الأساسي عند 12,230 نقطة تأكيدًا واضحًا على استعادة الاتجاه الصاعد على المدى القصير.
لذلك يُوصى المتداولون اللحظيون والمضاربون بتوخي الحذر عند التعامل مع أي إشارات ارتداد. منطقة الدعم الواقعة بين 11,900 و11,950 نقطة قد توفر فرصًا للشراء، لكن من الضروري وضع استراتيجيات دقيقة لإدارة المخاطر، مع تحديد وقف الخسائر أسفل هذه المنطقة. على الجانب الصاعد، تتوزع مستويات الاستهداف حول 12,000 - 12,035 نقطة كمرحلة أولى، ثم 12,200 - 12,230 نقطة كمستويات مقاومة هامة يمكن أن تعيد توجيه المؤشر نحو مناطق أعلى في حال تم تجاوزها بنجاح.
English version of the analysis
The "TASI" index is currently trading within a clear descending price channel on the intraday timeframe, indicating that sellers are in control of the market's short-term movement. In yesterday's session, the index attempted to stabilize at the lower boundary of this channel near the critical support level of 11,950 points. This area is pivotal due to its intersection with the 38.2% Fibonacci retracement level of the last upward wave on the daily timeframe, adding significant technical importance to this level. Furthermore, the 11,900-point level coincides with the 161.8% Fibonacci extension of the intraday corrective movement, further reinforcing its role as a key support zone.
In the near term, a bullish rebound is anticipated if the index continues to hold above the key support range between 11,900 and 11,950 points. This rebound could push the index towards the 12,000-point level as an initial target, with the potential for further upside towards 12,350 points, which represents a critical resistance level. A break above this level would be an early signal of a strong bullish momentum returning to the market, while closing above the primary resistance level at 12,230 points would confirm a short-term trend reversal to the upside.
Therefore, intraday traders and short-term speculators are advised to approach any rebound signals with caution. The support zone between 11,900 and 11,950 points could present buying opportunities, but it is essential to implement precise risk management strategies, including placing stop-loss orders below this zone. On the upside, the initial target levels are distributed around 12,000 to 12,035 points, followed by the 12,200 to 12,230-point range, which could serve as crucial resistance levels that may steer the index towards higher levels if successfully breached.
زمنبالطبع، إليك كود برمجي لاستراتيجية تداول تعتمد على MACD، وRSI، وBollinger Bands، والمتوسط المتحرك البسيط (SMA) لمدة 100 و200 فترة على فريم 15 دقيقة. سيتم تحديد هدف الربح والخسارة بـ20 نقطة.
```pinescript
//@version=5
strategy("MACD, RSI, Bollinger Bands with SMA 100 & 200", overlay=true)
// إعدادات المستخدم
macd_short_length = input(12, title="MACD Short Length")
macd_long_length = input(26, title="MACD Long Length")
macd_signal_smoothing = input(9, title="MACD Signal Smoothing")
rsi_length = input(14, title="RSI Length")
rsi_overbought = input(70, title="RSI Overbought Level")
rsi_oversold = input(30, title="RSI Oversold Level")
bb_length = input(20, title="Bollinger Bands Length")
bb_std_dev = input(2.0, title="Bollinger Bands Standard Deviation")
sma_100_length = input(100, title="SMA 100 Length")
sma_200_length = input(200, title="SMA 200 Length")
take_profit_points = input(20, title="Take Profit Points")
stop_loss_points = input(20, title="Stop Loss Points")
// حساب MACD
= ta.macd(close, macd_short_length, macd_long_length, macd_signal_smoothing)
// حساب RSI
rsi = ta.rsi(close, rsi_length)
// حساب Bollinger Bands
basis = ta.sma(close, bb_length)
dev = bb_std_dev * ta.stdev(close, bb_length)
upper_band = basis + dev
lower_band = basis - dev
// حساب المتوسط المتحرك البسيط
sma_100 = ta.sma(close, sma_100_length)
sma_200 = ta.sma(close, sma_200_length)
// إشارات الشراء والبيع
buy_signal = (crossover(macdLine, signalLine)) and (rsi < rsi_oversold) and (close < lower_band) and (close > sma_100) and (sma_100 > sma_200)
sell_signal = (crossunder(macdLine, signalLine)) and (rsi > rsi_overbought) and (close > upper_band) and (close < sma_100) and (sma_100 < sma_200)
// تنفيذ الصفقات بأوامر الشراء والبيع مع هدف الربح والخسارة
if (buy_signal)
strategy.entry("Buy", strategy.long, stop=close - stop_loss_points, limit=close + take_profit_points)
if (sell_signal)
strategy.entry("Sell", strategy.short, stop=close + stop_loss_points, limit=close - take_profit_points)
// رسم المؤشرات على الرسم البياني
plot(sma_100, title="SMA 100", color=color.blue)
plot(sma_200, title="SMA 200", color=color.red)
hline(rsi_overbought, "RSI Overbought Level", color=color.red)
hline(rsi_oversold, "RSI Oversold Level", color=color.green)
plot(upper_band, title="Upper Bollinger Band", color=color.orange)
plot(lower_band, title="Lower Bollinger Band", color=color.orange)
plot(macdLine, title="MACD Line", color=color.blue)
plot(signalLine, title="Signal Line", color=color.red)
```
### شرح الكود:
1. **المتغيرات المدخلة**: يمكنك ضبط معلمات MACD وRSI وBollinger Bands والمتوسط المتحرك البسيط وأهداف الربح والخسارة.
2. **حساب المؤشرات**:
- MACD.
- RSI.
- Bollinger Bands.
- SMA لفترة 100 و200.
3. **إشارات الشراء والبيع**:
- إشارة شراء عندما يتقاطع خط MACD فوق خط الإشارة، وRSI أقل من مستوى التشبع البيعي، والسعر أقل من الحد السفلي لـ Bollinger Bands، والسعر فوق SMA 100، وSMA 100 أعلى من SMA 200.
- إشارة بيع عندما يتقاطع خط MACD تحت خط الإشارة، وRSI أعلى من مستوى التشبع الشرائي، والسعر أعلى من الحد العلوي لـ Bollinger Bands، والسعر تحت SMA 100، وSMA 100 أقل من SMA 200.
4. **تنفيذ الصفقات**: يتم تنفيذ أمر شراء أو بيع مع تحديد هدف الربح والخسارة.
5. **رسم المؤشرات**: يتم رسم المؤشرات على الرسم البياني.
### تعليمات استخدام الكود:
1. انسخ الكود بالكامل.
2. افتح منصة TradingView.
3. انتقل إلى "Pine Editor" وألصق الكود.
4. احفظ الكود وطبقه على الرسم البياني.
يمكنك تعديل المعلمات في الجزء العلوي من الكود لضبط الاستراتيجية وفقًا لتفضيلاتك واحتياجاتك.
TradingView is Looking for a New Arabic Language ModeratorHi all,
We are looking for a new moderator for the Arabic Language Community to help support the existing team.
The role of a moderator on TradingView is quite broad but the short version is you are there to try and help others to get the most out of their TradingView experience while ensuring site rules are followed.
The role is an unpaid volunteer role but in return you will get access to the internal team (including the founders), be able to provide more direct feedback on the platform and future functionality, a free Premium account, free data packs, merchandise and typically much greater exposure for your profile and more followers across the site. It is also a great steppingstone to potentially taking on a full-time job with TradingView. Many moderators have over the years become full time employees and continue to add great value.
What we are looking for:
- You have a strong knowledge of the TradingView platform
- You have built a good reputation for yourself on TradingView by sharing quality content and being helpful to other users.
- A good starting point is:
-- a minimum of 100 ideas posted that have a good analysis & idea description,
-- you consistently get likes for your posted ideas,
-- you have more than 100 followers.
- You like to interact with people in a positive way while upholding the house rules and can appreciate other people’s opinions and share yours in a constructive way.
- Have at least an hour per day to spend helping the community and moderating.
- Are a respected member of TradingView for more than six months and have kept your violations of the house rules to an absolute minimum.
- Can communicate well in spoken and written English
- Have a good general trading knowledge.
If this sounds like you, and you would like to become a moderator and can spare an hour or two a day helping, have a look through these links:
ar.tradingview.com
and then if you feel like it is something you would like to do then please fill out the following form.
If you are interested, then please apply here: forms.gle
(Please fill the form in English).
Very happy to answer any questions you might have.
Just message @zAngus or @Nico.Muselle
متوسطاتts_b4b67b20_a322_4608_aa20_284927132cedts_b4b67b20_a322_4608_aa20_284927132cedترتيب متوسطات استراتيجية فنية1dayif ( MA_$CLOSE$_7 > MA_$CLOSE$_11 and MA_$CLOSE$_11 > MA_$CLOSE$_21 and MA_$CLOSE$_21 > MA_$CLOSE$_34 , 3, if ( MA_$CLOSE$_7 > MA_$CLOSE$_11 and MA_$CLOSE$_7 > MA_$CLOSE$_21 and MA_$CLOSE$_7 > MA_$CLOSE$_34 , 2, if ( MA_$CLOSE$_7 > MA_$CLOSE$_11 and MA_$CLOSE$_7 < MA_$CLOSE$_21 and MA_$CLOSE$_7 < MA_$CLOSE$_34 , 1, 0 ) ) )IF ( MA(CLOSE, 7) > MA(CLOSE, 11) AND MA(CLOSE, 11) > MA(CLOSE, 21) AND MA(CLOSE, 21) > MA(CLOSE, 34) , 3, IF ( MA(CLOSE, 7) > MA(CLOSE, 11) AND MA(CLOSE, 7) > MA(CLOSE, 21) AND MA(CLOSE, 7) > MA(CLOSE, 34) , 2, IF ( MA(CLOSE, 7) > MA(CLOSE, 11) AND MA(CLOSE, 7) < MA(CLOSE, 21) AND MA(CLOSE, 7) < MA(CLOSE, 34) , 1, 0 ) ) )