โœ–

Home Forums General Questions How can I get accurate values in camarilla pivot in 1-minute timeframe ?

How can I get accurate values in camarilla pivot in 1-minute timeframe ?

  • Author
    Posts
    • ๐Ÿ“ Question Details

      Iโ€™m using Camarilla pivot in my algo and calculating it from 1-minute candles.

      Iโ€™m already checking HLC properly, but still the pivot levels are not matching chart values.

      Am I missing something here?

    • 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)
Viewing 1 reply thread
×

Start a Discussion

Get help from the AlgoDelta community.

×

Welcome Back!

Enter your email to sign in or create an account. No passwords needed.

โณ

Pending Approval

โš ๏ธ

Delete This?

Are you sure you want to delete this? This action is permanent and cannot be undone.

Scroll to Top