لقد حصلت على صعوبة صغيرة مع iHighest ، لا بد لي من العثور على أكبر إغلاق بين الشموع 6 و 4. الخطأ رمز من مؤشر الاختتام ولكن النتيجة ليست صحيحة

كود مدرج #property version 1.00 #property description #include lt؛ stdlib.mqhgt؛ # تتضمن lt؛ stderror.mqhgt؛/- indior configurations #property indior_chart_window #property indior_buffers twoproperty indior_type1 DRAW_ARROW #property indior_width1 1 #property indior_color1 White #property indior_label1 Sell #property indior_type2 DRAW_ARROW #property indior_width2 1 #property indior_color2 White #property indior_label2 Buy int N؛ int FTimeFrame = 0؛/- indior buffers dual Buffer1 # 91؛ # 93 ؛؛ dual Buffer2 # 91؛ # 93 ؛؛/p ----------------------------------------------- ------------------- /| مخصص التهيئة الأولية تخدم |/p ----------------------------------------------- ------------------- int onInit () IndiorBuffers (2)؛ SetIndexBuffer (0 ، Buffer1)؛ SetIndexEmptyValue (0، 0)؛ SetIndexArrow (0، 242)؛ SetIndexBuffer (1، Buffer2)؛ SetIndexEmptyValue (1، 0)؛ SetIndexArrow (1، 241)؛ العودة (INIT_SUCCEEDED)؛/ ----------------------------------------------- ------------------- /| التكرار المخصص للخدمة/ ----------------------------------------------- ------------------- int OnCalculate (const int rates_total، const int prev_calculated، const datetime time # 91؛ # 93 ؛، const double available # 91؛ # 93؛ ، const double high # 91؛ # 93 ؛، const double low # 91؛ # 93 ؛، const double close # 91؛ # 93 ؛، Const extended tick_volume # 91؛ # 93 ؛، const long-term # 91؛ # 93 ؛، const int spread # 91؛ # 93؛ -RRB- int limit = rates_total - prev_calculated؛/- counting from 0 to rates_total ArraySetAsSeries (Buffer1، true)؛ ArraySetAsSeries (Buffer2، true)؛/- first zero إذا كانت (prev_calculated lt؛ 1) ArrayInitialize (Buffer1، 0)؛ ArrayInitialize (Buffer2، 0)؛ وإلا حد ؛/- حلقة رئيسية لـ (int I = limit-1؛ i gt؛ = 0؛ I--) إذا (I gt؛ = MathMin (5000-1، rates_total-1-50)) استمر ؛ bool Pattern = Open # 91؛ 1 I # 93؛ GT. إغلاق # 91؛ 1 I # 93؛ افتح # 91؛ 2 I # 93؛ GT. إغلاق # 91؛ 2 I # 93؛ افتح # 91؛ 3 I # 93؛ GT. إغلاق # 91؛ 3 I # 93؛ افتح # 91 ؛ 4 I # 93؛ لتر. إغلاق # 91؛ 4 I # 93 ؛؛ should (Pattern == true) N = iHighest (Symbol ()، PERIOD_CURRENT، MODE_CLOSE، 6 I، 4 I)؛ Buffer1 # 91؛ N # 93؛ = High # 91؛ N # 93؛ 30 * المرحلة. Assing Buffer1 مع عائد إغلاق أكبر (0)؛/ ----------------------------------------------- -------------------