Ik heb een klein probleem met iHighest, ik moet de hoogste sluiten tussen kaarsen 6 en 4. de codefout van de slotindex, maar het resultaat is niet correct
Code ingevoegd #property version 1.00 #property description # include lt; stdlib.mqhgt; # include lt; stderror.mqhgt;/--- indior settings #property indior_chart_window #property indior_buffers 2 #property 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 Koop int N; int FTimeFrame = 0;/--- indior buffers double Buffer1 # 91; # 93 ;; dubbele Buffer2 # 91; # 93 ;;/ ----------------------------------------------- ------------------- /| Custom indior initialisatie functie |/ ----------------------------------------------- ------------------- int OnInit () {IndiorBuffers (2); SetIndexBuffer (0, Buffer1); SetIndexEmptyValue (0, 0); SetIndexArrow (0, 242); SetIndexBuffer (1, Buffer2); SetIndexEmptyValue (1, 0); SetIndexArrow (1, 241); terugkeer (INIT_SUCCEEDED); }/ ---------------------------------------------- -------------------- /| Aangepaste indior iteratiefunctie |/ ----------------------------------------------- ------------------- int OnCalculate (const int rates_total, const int prev_calculated, const datetime time # 91; # 93 ;, const double open # 91; # 93; , const double high # 91; # 93 ;, const double low # 91; # 93 ;, const double close # 91; # 93 ;, const long tick_volume # 91; # 93 ;, const long volume # 91; # 93; , const int spread # 91; # 93;) {int limit = rates_total - prev_calculated;/--- telling van 0 tot rates_total ArraySetAsSeries (Buffer1, true); ArraySetAsSeries (Buffer2, true);/--- initial zero if (prev_calculated lt; 1) {ArrayInitialize (Buffer1, 0); ArrayInitialize (Buffer2, 0); } else limit ;/--- hoofdlus voor (int i = limit-1; i gt; = 0; i--) {if (i gt; = MathMin (5000-1, rates_total-1-50)) ga verder; bool Patroon = Open # 91; 1 i # 93; gt; Sluiten # 91; 1 i # 93; Open # 91; 2 i # 93; gt; Sluiten # 91; 2 i # 93; Open # 91; 3 i # 93; gt; Sluiten # 91; 3 i # 93; Open # 91; 4 i # 93; lt; Sluiten # 91; 4 i # 93 ;; if (Pattern == true) {N = iHighest (Symbol (), PERIOD_CURRENT, MODE_CLOSE, 6 i, 4 i); Buffer1 # 91; # N 93; = Hoog # 91; N # 93; 30 * punt; Assing Buffer1 met hogere afsluiting}} return (0); }/ ---------------------------------------------- --------------------