1 مرفق
تحويل كود من لغة Pine Script الى لغة MQ5 بشكل بسيط
السلام عليكم احتاج احد يبرمج لي روبرت يدخل صفقات كل ما كسر الخط ويامن كل 10 نقاط الهدف 50 والستوب لوز 30
//@version=5
indicator("Trade ", overlay=true)
// إدخال التاريخ المحلي (RTH+3)
selected_year = input.int(2025, title="Year (Previous Day)")
selected_month = input.int(5, title="Month (Previous Day)")
selected_day = input.int(13, title="Day (Previous Day)")
// نحول الأوقات إلى UTC (ناقص 3 ساعات)
time_0401_utc = timestamp("UTC", selected_year, selected_month, selected_day, 1, 1) // 04:01 - 3h = 01:01 UTC
time_1601_utc = timestamp("UTC", selected_year, selected_month, selected_day, 13, 1) // 16:01 - 3h = 13:01 UTC
// أوقات نهاية الخطوط
end_0900_utc = timestamp("UTC", selected_year, selected_month, selected_day, 6, 0) // 09:00 - 3h = 06:00 UTC
end_0000_utc = timestamp("UTC", selected_year, selected_month, selected_day, 21, 0) // 00:00 (اليوم التالي) - 3h = 21:00 UTC
// تطابق الشموع
is0401 = (time == time_0401_utc)
is1601 = (time == time_1601_utc)
// عرض إشارة تأكيد
plotshape(is0401, title="04:01 Match", location=location.abovebar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(is1601, title="16:01 Match", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
// خطوط شمعة 04:01 ⟶ إلى 09:00 صباحًا
if is0401
line.new(x1=time, y1=high, x2=end_0900_utc, y2=high, xloc=xloc.bar_time, color=color.black, width=2)
line.new(x1=time, y1=low, x2=end_0900_utc, y2=low, xloc=xloc.bar_time, color=color.black, width=2)
// خطوط شمعة 16:01 ⟶ إلى 12:00 ليلًا
if is1601
line.new(x1=time, y1=high, x2=end_0000_utc, y2=high, xloc=xloc.bar_time, color=color.black, width=2)
line.new(x1=time, y1=low, x2=end_0000_utc, y2=low, xloc=xloc.bar_time, color=color.black, width=2)