Yes, this will happen in the one minute candle data is used from the historical data.
Because, Camarilla (and most pivots) should not be calculated from one minute candles.
Correct approach:
You have to calculate pivot in the previous full day candle not the previous day one-minute candles.
Because the last candle close in the minute candle is different from the previous full day candle – just slightly different of some points but still the values in pivot will be inaccurate.
Below is the code that you can refer:
def camarilla_pivot(prev_high, prev_low, prev_close):
diff = prev_high - prev_low
levels = {
"H1": prev_close + (diff * 1.1 / 12),
"H2": prev_close + (diff * 1.1 / 6),
"H3": prev_close + (diff * 1.1 / 4),
"H4": prev_close + (diff * 1.1 / 2),
"PP": (prev_high + prev_low + prev_close) / 3.0,
"L1": prev_close - (diff * 1.1 / 12),
"L2": prev_close - (diff * 1.1 / 6),
"L3": prev_close - (diff * 1.1 / 4),
"L4": prev_close - (diff * 1.1 / 2),
}
return levels
# Example (use previous day data of 1 day timeframe candle)
prev_high = 200
prev_low = 180
prev_close = 190
levels = camarilla_pivot(prev_high, prev_low, prev_close)
print(levels)