MQL5 Code-Question

 

I want to change following code snippet.

As far as I understand it, it searches now for the highest high/lowest low in form of a bar number within a period and then gets the quote for this bar:


for(i=limit_ln;i<rates_total && !IsStopped();i++)

     {      
      h=iHighest(Symbol(),Period(), MODE_HIGH,m_period_calc,(rates_total-i-1));
      H=high[rates_total-1-h];
      l=iLowest(Symbol(),Period(),MODE_LOW,m_period_calc,(rates_total-i-1));
      L=low[rates_total-1-l];      
      if(H==0 || L==0)
        {
         Print ("Error (H==0 || L==0),  ",GetLastError());

        }


I want to change this to get the close of the current bar and the open of a number of bars before (15) this bar so I did try this but it doesnt seem to work anyhow :/

  //H=close(Symbol(),Period(),i);

   //L=open(Symbol(),Period(),i+15);


Any help would be very appreciated!

Thank you very much :)

Edit: I did figure it out on my own by now thx anyways.
Reason: