Array out of range in Need of help - page 6

 
Dark Kchlyzov:

There is a levelLow_D1_Level , then we need to get the value of the next level Min_D_Level, which will be the next lowest in the history and will be lower than Low_D1_Level.

I do not know how to explain further. If you run the code in the tester with the visualization I think everything is visible.

Ok I am a dummy !

Draw, or make a screenshot of the tester. ))) Every creator has their own terminology))))

Next level or day?

 
Dark Kchlyzov:

There is a levelLow_D1_Level , then we need to get the value of the next level Min_D_Level, which will be the next lowest in the history and will be lower than Low_D1_Level.

I do not know how to explain further. If you run the code in the tester with the visualization I think everything is visible.

    As I see

    void Level()
    {
    
     Low_D1_Level   = iLow (_Symbol,PERIOD_D1,1);   // Возвращает значение минимальной цены бара  D1
    
     for(int i = 1; ;i++) 
        {
         if(iLow(_Symbol,PERIOD_D1,i)< Low_D1_Level)
              {
               Min_D_Level = iLow(_Symbol,PERIOD_D1,i); break; 
              }  
        } 
     

    You have the current day low

    Low_D1_Level   = iLow (_Symbol,PERIOD_D1,1);   // Возвращает значение минимальной цены бара  D1

    Next, you check if there is a lower value in the history than the current day minimum.

     for(int i = 1; i<ArrayRange(Bar_data_D1,0) ;i++)
        {
         if(Bar_data_D1 [i][2]>=0)
           {
            if( Bar_data_D1 [i][2] < Low_D1_Level)
              {
               Min_D_Level = Bar_data_D1 [i][2];break;
              }
           }   
        } 
    

    if so, assign Min_D_Level to this minimum value, and if not, the value stays the same.

    right?

    How deep in the history do you want to search for the minimum Min_D_Level?

     
    Aleksei Stepanenko:

    You have the current day low

    Next, you check if there is a lower value in the history than the current day minimum.

    if so, assign Min_D_Level to this minimum value, and if not, the value stays the same.

    right?

    How deep in the history do you want to search for the minimum Min_D_Level?

    That's right!

    How deep in the history do you want to search for the Min_D_Level?

    To the whole history that is available for this symbol.

     
    So that would be the minimum of the whole schedule. Do you need it?
     

    Left only the daily lines, can't get the idea yet


     
    Aleksei Stepanenko:

    Left only the daily lines, can't get the idea yet


    Aleksei Stepanenko:
    So it will be the minimum of the whole chart. Do you need it?

    (If you are interested in the idea, I think it is inappropriate to discuss it here.

    Of course I will share.)

    So it will be a minimum of all the graphics. Do you need it?

    If there is no actual minimum in the history, then there is only Low_D1_level and Min_D_Level we do not redraw.

     
    Dark Kchlyzov:

    (If you're interested in the idea, I don't think it's appropriate to discuss it here.

    Of course I will.)

    So that would be the minimum of the whole schedule. Do you need it?

    If there is no actual minimum in the history, then there is only a Low_D1_level and Min_D_Level we do not redraw.

    The daily extrema, and what you find are in fact extrema, lows (or highs) have quite a big distance from the current price. The difference between the lows and highs on the 132 days on the eve is more than 12300 pips. Price from the nearest low of 2000, from the high of 800.

    I don't get it either.

     
    Dark Kchlyzov:

    (If you're interested in the idea, I don't think it's appropriate to discuss it here.

    Of course I will.)

    So that would be the minimum of the whole schedule. Do you need it?

    If this is not the actual minimum in the history, then there is only Low_D1_level and Min_D_Level we do not redraw.

    It is 2.30 .

    We will continue tomorrow!

    For the smartest, it is night and not 14.30 -:)

    I do not want to upset anyone in any way !!!

    Thank you all very much !!! For today !!!

     

    Aleksei Stepanenko

    Great respect!!!

    At least the man deigned to get to the bottom of it.

    Aleksei Stepanenko
    Aleksei Stepanenko
    • www.mql5.com
    Профиль трейдера