Download MetaTrader 5

Getting Price at a vertical line

To add comments, please log in or register
Write your articles using our editor. It is convenient!
yorto 2016.03.13 18:10 


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?


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

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