Getting Price at a vertical line

Back to topics list To post a new topic, please log in or register
avatar
1
yorto 2016.03.13 19: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;
      }  
   }
avatar
872
eevviill 2016.03.13 20:24 #
 
iBarShift
Back to topics list  

To add comments, please log in or register