Besides, I tried to use this code in a 2min TF, but it didn’t work properly since there can be gaps between candles in that TF (the full amount of candles is 195 per day in the US market, but you sometimes get 194 or 193 because of gaps in the price).