Download MetaTrader 5
To add comments, please log in or register
Does your signal already have a lot of of subscribers? It's time to think about the paid subscription!
yorto
5
yorto 2016.03.13 18:10 

Hallo,

just started coding two weeks ago so I assume my code often is to cumbersome and slow, so be lenient ;)

I want to get the price (low price is this case) of a candlestick where a certain vertical line is placed. For iLow I would need to use a shift which doesn't seem wise to me because it's a relative Point while a datetime is absolute.

I solved this by using an array, which seems a bit bloated to me, when I would only need something like an iLow with datetime instead of shift.

Any hints for a slim code?

Cheers

double PriceLow_array [][6];
datetime dt = ObjectGet("VLine", OBJPROP_TIME1);

ArrayCopyRates(PriceLow_array,NULL,0);
   for(int cnt=0;cnt<1000;cnt++) {
      if(dt == (datetime)double_array[cnt][0]) {
         Print("Got it! " + double_array[cnt][2]);
         break;
      }  
   }
Vasyl Nosal
18226
Vasyl Nosal 2016.03.13 19:24  
iBarShift
/
To add comments, please log in or register