0% found this document useful (0 votes)
176 views3 pages

موشر التنين

This document is a Pine Script code for a trading indicator called 'موشر التنين' which plots real close dots and allows for the configuration of an EMA filter. It highlights specific candle times and generates buy/sell signals based on price movements relative to defined thresholds, with corresponding alerts and visual markers for take profit and stop loss levels. The script includes user inputs for customization and manages the display of signals and boxes on the trading chart.

Uploaded by

aaeee005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
176 views3 pages

موشر التنين

This document is a Pine Script code for a trading indicator called 'موشر التنين' which plots real close dots and allows for the configuration of an EMA filter. It highlights specific candle times and generates buy/sell signals based on price movements relative to defined thresholds, with corresponding alerts and visual markers for take profit and stop loss levels. The script includes user inputs for customization and manages the display of signals and boxes on the trading chart.

Uploaded by

aaeee005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

//@version=5

indicator('‫' موشر التنين‬, overlay=true)

// ‫إعداد عرض نقاط الإغالق الحقيقي‬


plotrealclosedots = input(true, title='Show real close dots')
realclosecolour = input(color.new(#41ffb0, 0), title='Real close dot color') // ‫لون‬
‫النقاط‬

// ‫تعطيل فلتر‬/‫ تفعيل‬EMA


use_ema_filter = input(false, title='Enable EMA Filter')

// ‫إعداد أقصى عدد للشموع بعد الإشارة‬


max_candles_after_signal = input.int(5, title='Max candles after signal', minval=1)

// ‫ حساب‬EMA
ema_length = 100
ema_value = ta.ema(close, ema_length)

// ‫جلب سعر الإغالق الحقيقي‬


real_price = syminfo.prefix + ":" + syminfo.ticker
real_close = request.security(real_price, "", close, gaps=barmerge.gaps_off,
lookahead=barmerge.lookahead_off)

// ‫ رسم النقاط باستخدام‬plot


plot(series=plotrealclosedots ? real_close : na,
title='Real close dots',
color=realclosecolour,
linewidth=3,
style=plot.style_circles)

// 24:01 ,... ,2:01 ,1:01 ‫إعداد جدول التوقيت للشموع عند‬


var timings = array.new_string()
if bar_index == 0
for hr = 0 to 23
array.push(timings, str.tostring(hr) + ':01')

// ‫التحقق من وقت الشمعة الحالية‬


is_highlighted = false
liquidity_hour = false
var int hr_number = na
var float hr_loop = na
var float min_loop = na

for i = 0 to array.size(timings) - 1
t = array.get(timings, i)
time_parts = str.split(t, ':')
hr_loop := str.tonumber(array.get(time_parts, 0))
min_loop := str.tonumber(array.get(time_parts, 1))

if hr_loop == hour(time) and min_loop == minute(time)


is_highlighted := true
hr_number := i + 1
break

// ‫ ساعات للوقت المعروض‬3 ‫إضافة‬


hr_display = int(hr_loop + 3) % 24

// ‫رسم البوكس عندما تكون الشمعة في الوقت المحدد‬


var box box_id = na
var int candle_count = 0
var bool signal_shown = false

if is_highlighted
box_id := box.new(left=bar_index, top=high, right=bar_index+55, bottom=low,
border_color=na, bgcolor=color.new(color.blue, 90))
candle_count := 0
signal_shown := false

// ‫إضافة ليبل للوقت‬


label_color = liquidity_hour ? color.yellow : color.blue
label.new(bar_index, high, text=str.tostring(hr_display) + ':01',
color=label_color, style=label.style_label_down, size=size.small)

// ‫مراقبة الشموع بعد الإشارة‬


if not na(box_id) and not signal_shown
if candle_count < max_candles_after_signal
// ‫شرط البيع‬
if close < box.get_bottom(box_id) and real_close < box.get_bottom(box_id)
and (not use_ema_filter or real_close < ema_value)
sell_price = real_close
tp1 = sell_price - 2
tp2 = sell_price - 3
sl = box.get_top(box_id)

// ‫رسم الخطوط والتسميات‬


line.new(bar_index+1, tp1, bar_index+50, tp1, color=color.green,
width=2)
label.new(bar_index+1, tp1, "TP1", color=color.green,
style=label.style_label_right, size=size.small)

line.new(bar_index+1, tp2, bar_index+50, tp2, color=color.green,


width=2)
label.new(bar_index+1, tp2, "TP2", color=color.green,
style=label.style_label_right, size=size.small)

line.new(bar_index+1, sell_price, bar_index+50, sell_price,


color=color.red, width=2)
label.new(bar_index+1, sell_price, "Sell", color=color.red,
style=label.style_label_right, size=size.small)

line.new(bar_index+1, sl, bar_index+50, sl, color=color.red, width=2,


style=line.style_solid)
label.new(bar_index+1, sl, "SL", color=color.red,
style=label.style_label_right, size=size.small)

// ‫رسم البوكسات‬
box.new(left=bar_index+1, top=sl > tp2 ? sl : tp2, right=bar_index+50,
bottom=sl < tp2 ? sl : tp2, bgcolor=color.new(color.red, 80))
box.new(left=bar_index+1, top=tp2 > sell_price ? tp2 : sell_price,
right=bar_index+50, bottom=tp2 < sell_price ? tp2 : sell_price,
bgcolor=color.new(color.green, 80))

// ‫التنبيه‬
alert('Sell Signal\nEntry: ' + str.tostring(sell_price) + '\nTP1: ' +
str.tostring(tp1) + '\nTP2: ' + str.tostring(tp2) + '\nSL: ' + str.tostring(sl),
alert.freq_once_per_bar)

signal_shown := true
// ‫شرط الشراء‬
else if close > box.get_top(box_id) and real_close > box.get_top(box_id)
and (not use_ema_filter or real_close > ema_value)
buy_price = real_close
tp1 = buy_price + 2
tp2 = buy_price + 3
sl = box.get_bottom(box_id)

// ‫رسم الخطوط والتسميات‬


line.new(bar_index+1, tp1, bar_index+50, tp1, color=color.green,
width=2)
label.new(bar_index+1, tp1, "TP1", color=color.green,
style=label.style_label_right, size=size.small)

line.new(bar_index+1, tp2, bar_index+50, tp2, color=color.green,


width=2)
label.new(bar_index+1, tp2, "TP2", color=color.green,
style=label.style_label_right, size=size.small)

line.new(bar_index+1, buy_price, bar_index+50, buy_price,


color=color.green, width=2)
label.new(bar_index+1, buy_price, "Buy", color=color.green,
style=label.style_label_right, size=size.small)

line.new(bar_index+1, sl, bar_index+50, sl, color=color.red, width=2,


style=line.style_solid)
label.new(bar_index+1, sl, "SL", color=color.red,
style=label.style_label_right, size=size.small)

// ‫رسم البوكسات‬
box.new(left=bar_index+1, top=tp2 > buy_price ? tp2 : buy_price,
right=bar_index+50, bottom=tp2 < buy_price ? tp2 : buy_price,
bgcolor=color.new(color.green, 80))
box.new(left=bar_index+1, top=buy_price > sl ? buy_price : sl,
right=bar_index+50, bottom=buy_price < sl ? buy_price : sl,
bgcolor=color.new(color.red, 80))

// ‫التنبيه‬
alert('Buy Signal\nEntry: ' + str.tostring(buy_price) + '\nTP1: ' +
str.tostring(tp1) + '\nTP2: ' + str.tostring(tp2) + '\nSL: ' + str.tostring(sl),
alert.freq_once_per_bar)

signal_shown := true
candle_count += 1

You might also like