اهلا بالجميع. أحتاج إلى مساعدة بشأن الشفرة التي تم لصقها أدناه. إنه تنبيه عبر متوسط ​​متحرك بسيط أنني قمت بتعديل بعض الشيء وأضف تنبيهًا عبر البريد الإلكتروني. لست متأكدًا مما إذا كان تنبيه البريد الإلكتروني سيعمل مع استمرار تلقي رسالة خطأ واحدة عندما أقوم بترجمة. لقد قمت بلصق الكود أدناه

مررت بالشفرة عدة مرات ولا أستطيع تحديد المشكلة. شكرا مقدما على كل ما تبذلونه من مساعدة.

الخطأ يقول ... '\ end_of_program' - قوس يسرى غير متوازن



// ----------------------------------------------- -------------------
//| MACrossEarlyAlert.mq4 |
//| ماريانو سيلفا
//| |
// ----------------------------------------------- -------------------
#property copyright Mariano Silva
# رابط العقار

#property indior_chart_window
//---- معلمات الإدخال
extern bool EmailAlert = false؛
extern Int FastMAPeriod = 50؛
extern string Type = 0-SMA، 1-EMA؛
extern int FastMAType = 1؛
extern Int SlowMAPeriod = 1؛
extern Int SlowMAType = 0؛
extern Int EarlyPips = 15؛
extern Int ResetAlert = 20؛
extern color LineColor = Orange؛
// ----------------------------------------------- -------------------
//| وظيفة التهيئة مؤشر مخصص
// ----------------------------------------------- -------------------
int init ()
{
//---- المؤشرات
//----
عودة (0)؛
}
// ----------------------------------------------- -------------------
//| وظيفة مخصصة مؤشر تسييل |
// ----------------------------------------------- -------------------
int deinit ()
{
string LineName؛
//----
LineName = StringConenate (FastMAPeriod،، SlowMAPeriod، MA Cross)؛
ObjectDelete (LineName)؛
//----
عودة (0)؛
}
// ----------------------------------------------- -------------------
//| وظيفة التكرار مؤشر مخصص
// ----------------------------------------------- -------------------
بداية int ()
{
//int counted_bars = IndiorCounted ()؛

مزدوجة FastMALastBar ، SlowMalastBar ، PriceToCross ، عبر ، FastMATest ، SlowMATest ؛
bool AlertEnabled = true؛
string LineName = StringConenate (FastMAPeriod،، SlowMAPeriod، MA Cross)؛


//LineName = StringConenate (FastMAPeriod،، SlowMAPeriod، MA Cross)؛

//----

إذا (NewBar ())
{
FastMALastBar = IMA (NULL، 0، FastMAPeriod، 0، FastMAType، PRICE_CLOSE، 1)؛
SlowMALastBar = IMA (NULL، 0، SlowMAPeriod، 0، SlowMAType، PRICE_CLOSE، 1)؛
PriceToCross = فتح [0]؛
الصليب = FastMALastBar-SlowMALastBar.


إذا (Crossgt، 0.0)
{
بينما (Crossgt، 0.0)
{
PriceToCross = PriceToCross نقطة.
FastMATest = CalcMA (FastMAPeriod، FastMAType، PriceToCross، FastMALastBar)؛
SlowMATest = CalcMA (SlowMAPeriod، SlowMAType، PriceToCross، SlowMALastBar)؛
الصليب = FastMATest-SlowMATest.
}
}
آخر
{
بينما (Crosslt، 0.0)
{
PriceToCross = PriceToCross نقطة.
FastMATest = CalcMA (FastMAPeriod، FastMAType، PriceToCross، FastMALastBar)؛
SlowMATest = CalcMA (SlowMAPeriod، SlowMAType، PriceToCross، SlowMALastBar)؛
الصليب = FastMATest-SlowMATest.
}
}


ObjectDelete (LineName)؛
drawLine (PriceToCross، LineName، LineColor، 0)؛

}

إذا (AlertEnabled)
{
إذا (MathAbs (إغلاق [0] -PriceToCross) لتر. = EarlyPips * نقطة)
{
تنبيه (Close to، FastMAPeriod،، SlowMAPeriod، MA Cross on، Symbol ()،، Period ())؛

إذا كان EmailAlert SendMail (Close to، FastMAPeriod،، SlowMAPeriod، MA Cross on، Symbol ()،، Period ()؛

AlertEnabled = كاذبة؛
}
}
آخر
{
إذا (MathAbs (إغلاق [0] -PriceToCross) GT؛ = ResetAlert * نقطة)
{
AlertEnabled = صحيح.
}
}





//----
عودة (0)؛
}
// ----------------------------------------------- -------------------


double CalcMA (int MAPeriod، int MAType، double PriceTest، double LastMA)
{
مزدوج ماجستير ، العلاقات العامة ؛

التبديل (MAType)
{
الحالة 0:
{
MA = ((LastMA * MAPeriod) من مسافة قريبة، [MAPeriod] PriceTest)MAPeriod.
استراحة؛
}
حالة 1:
{
العلاقات العامة = 2.0(MAPeriod 1)؛
MA = PriceTest * العلاقات العامة LastMA * (1-العلاقات العامة)؛
استراحة؛
}
}

عودة (MA)؛
}

void drawLine (ضعف lvl ، اسم السلسلة ، Col col ، نوع int)
{
ObjectCreate (الاسم ، OBJ_HLINE ، 0 ، الوقت [0] ، lvl) ؛/، الوقت [0] ، lvl) ؛

إذا (اكتب == 1)
ObjectSet (الاسم ، OBJPROP_STYLE ، STYLE_SOLID) ؛
آخر
ObjectSet (الاسم ، OBJPROP_STYLE ، STYLE_DOT) ؛

ObjectSet (الاسم ، OBJPROP_COLOR ، كول) ؛
ObjectSet (الاسم، OBJPROP_WIDTH، 1)؛

إرجاع؛
}


bool NewBar () {
ثابت تاريخ Datetime.
datetime curbar = Time [0]؛
إذا (lastbar! = curbar)
{
lastbar = curbar.
العودة (صحيح) ؛
}
else {
عودة كاذبة)؛
}
}