What time the candle closed ?

To add comments, please log in or register
rodrigoabrao
277
rodrigoabrao  
Hi guys,

I have this huge cod, and I got a HUGE amount of knowledge here. Thank you for that. 
I would ask one more time. 

So, I have this function 
double Close_D_1(int index) //Close5_ROLAGEM(current+1);
  {
   double arr[];
   double Close_D_1=0;
   ArraySetAsSeries(arr,true);
   int copied=CopyClose(ATIVO_1_A,PERIOD_D1,0,Bars(ATIVO_1_A,PERIOD_D1),arr);

   if(copied>0 && index<copied) Close_D_1=arr[index];
   return (Close_D_1);
  }
it basically takes the candle close value. if I call Close_D_1(+10), it would returns 10 candles before close value. 
Now, I ask, is there a possibility of getting the actually time ( which day and time ) such candle happened ? Thanks !!
Seng Joo Thio
748
Seng Joo Thio  
rodrigoabrao:
I have this huge cod, and I got a HUGE amount of knowledge here. Thank you for that. 
I would ask one more time. 
So, I have this function 
it basically takes the candle close value. if I call Close_D_1(+10), it would returns 10 candles before close value. 
Now, I ask, is there a possibility of getting the actually time ( which day and time ) such candle happened ? Thanks !!

Wow! You've copied the entire array just to extract one value... have you considered using iClose() instead?

For time of any candle, you can use CopyTime(), or iTime(). Time returned will be the open time of that candle, and you can easily add timeframe*60 to get the close time.

rodrigoabrao
277
rodrigoabrao  
WOW ! it seems it is a new function. I was using an old manual. Thanks, it would make my code runs better. 
In the old version, it seems the function I was seeking for is "CopyTime". 

Thank you a lot brother!
To add comments, please log in or register