Fixed. It was some while loop that never ends.
But now tell me something:
http://prntscr.com/ae4p85
http://i.imgur.com/P8zWbMI.png
Between these two bars there are few days. I am searching for the Candle ID at 00:00 and it doesn't exists. So which one of these two is more correct? Candle 0 or Candle 1?
If Candle 0, then this is the current candle and it's Candle Close value changes. So we want to get Close at 00:00, but instead we are getting Close of the current candle, which also changes all the time...
What is more sad is that candles from this black hole doesn't exists in lower or higher timeframes, so from where can we get the value we want?