ฉันมีปัญหาเล็ก ๆ น้อย ๆ กับ iHighest ฉันต้องหาจุดสูงสุดระหว่าง candles 6 และ 4 ข้อผิดพลาดของ code ของดัชนีการปิด แต่ผลไม่ถูกต้อง
โค้ดแทรก # รุ่นคุณสมบัติ 1.00 # คุณสมบัติคำอธิบาย #include lt; stdlib.mqhgt; #include lt; stderror.mqhgt;/# การตั้งค่า indior # คุณสมบัติ indior_chart_window # property indior_buffers 2 # property indior_type1 DRAW_ARROW # property indior_width1 1 # property indior_color1 # คุณสมบัติ indior_label1 ขาย # คุณสมบัติ indior_type2 DRAW_ARROW # คุณสมบัติ indior_width2 1 # คุณสมบัติ indior_color2 สีขาว # int FTimeFrame = 0;/--- indior buffers double Buffer1 # 91; # 93 ;; double Buffer2 # 91; # 93 ;;/ ----------------------------------------------- ------------------- /| ฟังก์ชันการเตรียมใช้งาน indior แบบกำหนดเอง |/ ----------------------------------------------- ------------------- int OnInit () {IndiorBuffers (2); SetIndexBuffer (0, Buffer1); SetIndexEmptyValue (0, 0); SetIndexArrow (0, 242); SetIndexBuffer (1, Buffer2); SetIndexEmptyValue (1, 0); SetIndexArrow (1, 241); กลับ (INIT_SUCCEEDED); }/ ---------------------------------------------- -------------------- /| ฟังก์ชันย้ำ indior ที่กำหนดเอง |/ ----------------------------------------------- ------------------- int OnCalculate (const int rates_total, const int prev_calculated, const เวลา # 91; # 93 ;, const เปิดสองครั้ง # 91; # 93; , const double # 91 สูง # 93 ;, const double # 91; # 93; # const; const # 91; # 93; # const; , const int spread # 91; # 93;) {int limit = rates_total - prev_calculated;/--- นับจาก 0 เป็น rate_total ArraySetAsSeries (Buffer1, true); ArraySetAsSeries (บัฟเฟอร์ 2 จริง);/--- ศูนย์เริ่มต้นถ้า (prev_calculated lt; 1) {ArrayInitialize (Buffer1, 0); ArrayInitialize (Buffer2, 0); } else limit ;/--- ห่วงหลักสำหรับ (int i = limit-1; i gt; = 0; i--) {if (i gt; = MathMin (5000-1, rates_total-1-50)) ดำเนินการต่อ รูปแบบ bool = เปิด # 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; lt; ปิด # 91; 4 i # 93 ;; if (Pattern == true) {N = iHighest (Symbol (), PERIOD_CURRENT, MODE_CLOSE, 6 i, 4 i); Buffer1 # 91; N # 93; = สูง # 91; N # 93; 30 * จุด; Assing Buffer1 กับการปิดที่สูงขึ้น}} return (0); }/ ---------------------------------------------- --------------------