OPEN-SOURCE SCRIPT

[volfgang] Pivot Levels (Open, Close, High, Low)

This script provides a clear and consistent way to track key price levels from Weekly and Daily bars, directly on your current chart interval.

The default colours are;
Today & This Week Open = White
Yesterday & Previous Week Open = Cream
Yesterday's High = Red
Yesterday's Low = Green
Weekly Pivots are 2px, and Daily Pivots are 1px.

Instead of requiring manual referencing of daily or weekly charts, these significant levels are automatically drawn and updated in real time, extending to the right as new bars form.

It adds value by helping traders quickly identify potential support/resistance zones and compare intraday price action with higher-timeframe pivots. This approach can aid in scalping, day trading, or swing trading strategies that rely on past price levels for trade entries, exits, or stop loss placement.

Daily Pivots Displayed Intraday

The script imports the previous day’s High, Low, Open, and Close and draws lines on the current chart, so you can see exactly where those levels lie on any intraday timeframe. You can easily change the colour of these lines in the menu.
Instead of switching between multiple charts for daily references, you can keep an intraday chart open and still watch how price behaves around these important daily pivots.


Weekly Pivots for Broader Context

In addition to daily levels, it also shows the previous week’s Open and Close. This feature helps traders who want to maintain a broader perspective and gauge the market’s weekly trend or bias while remaining on lower timeframes.


Automatic Line & Label Management

Each new trading day triggers a “session change” in the code, prompting the script to delete old lines and labels for daily levels. This keeps your chart from getting cluttered with outdated lines.

Weekly lines and labels follow the same approach, ensuring only the most recent weekly levels are highlighted.

Real-Time Extension

Lines are continuously extended to the right as new bars print, ensuring that you always have an updated view of your key price levels without any manual adjustments.
On the last bar, the script shifts to a time-based coordinate system for seamless visual extension.


Minimal Recalculation

This script uses security() calls in a carefully optimized way to reduce unnecessary recalculations and avoid repaint issues. By referencing open[1], close[1], etc., the lines remain fixed once the daily (or weekly) candle is confirmed.

Flexible Usage

You can apply this script to any symbol on TradingView. It’s especially beneficial for Forex pairs, indices, futures, or cryptocurrencies where you want to track significant past levels.

If you’re a scalper looking for areas of likely reaction, or a swing trader watching weekly opens for trend confirmation, these levels can be integral to your technical approach.

How to Use

Add to Chart: Click the “Add to Favorite Indicators” or “Apply to Chart” button once published.
Enable or Disable Previous Day Bars: Use the script’s input to toggle the display of previous day’s High, Low, Open, and Close lines if you only want weekly lines (or vice versa).

Customize Visuals: You can change line colors, width, and label text in the “Style” or “Inputs” tab. Adjust them to fit your preferred color scheme.

Interpretation:
Daily levels typically carry relevance for the next trading session. They can be used for intraday support/resistance, breakout checks, or gap fills.

Weekly levels help identify more prominent zones for bigger moves or for understanding overall sentiment from the prior week.

Conceptual Underpinnings

Support/Resistance: Past opens/closes often act as support or resistance because they represent important points of reference (where trading started or ended during a prior session).

Market Psychology: Many traders watch daily or weekly closes to gauge momentum and bias, which can become self-fulfilling as more participants join around those levels.

Improved Situational Awareness: By having these levels automatically drawn and updated, traders avoid missing critical areas where price may pivot.


This script is intentionally open-source to help traders study and personalize it.
By merging daily and weekly pivot concepts in a single script, it provides a convenient and efficient tool—rather than a simple mashup, it unifies two timeframes that are crucial in short-term and medium-term trading decisions.
Remember that these levels alone do not constitute a complete trading system; they are best used as part of a broader strategy involving risk management, additional technical signals, and market context.
Pivot PointsPivot points and levels

Skrip open-source

Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menerbitkannya sebagai sumber terbuka, sehingga para trader dapat memahami dan memverifikasinya. Hormat untuk penulisnya! Anda dapat menggunakannya secara gratis, namun penggunaan kembali kode ini dalam publikasi diatur oleh Tata Tertib. Anda dapat memfavoritkannya untuk digunakan pada chart

Inggin menggunakan skrip ini pada chart?

Pernyataan Penyangkalan