Delayed Opening Price Line with Guardrails

The lines are drawn at the open price of the first candle after the delay period, and then a specified increment above and below that price level. These increments default to 80 and 100, and can be adjusted in the indicator settings.
Most markets, indices, and equities have a finite and consistent range of price movement within a trading day. Eg. a particular stock may usually move no more that $50 up or down in a given day, which can be proven by looking at a historical chart. This indicator allows the user to quickly display that range on the chart once it's been defined.
Important note: This indicator is designed to be used on an intra-day chart - eg. minutes, or hourly. It will give an error if used on a longer time-frame chart.
This indicator will draw 5 price level lines on the chart each day, beginning at the first candle after a delay period specified by the user (default is 30 minutes from market open).
The lines are drawn at the specified price (open, high, low, close, etc.) from the first candle after the delay period (default is Open), and then at specified increments above and below that price level (defaults are 80 and 100).
- USAGE:
- Determine the typical range of the underlying you are trading
- Determine the delay from market open you wish to use to set your range
- Set your parameters in the indicator settings
- Manage risk by trading inside or outside these parameters, depending on your trade strategy
Important note: This indicator is designed to be used on an intra-day chart only - eg. minutes, or hourly. It will give an error if used on a longer time-frame chart.
- SETTINGS[**]Show Historical Data - Display only the current day's price lines for real-time use only, or show historical lines for additional analysis.
[**]Delay After Market Open - length of time, in ticks or minutes, to delay before setting the starting price for the price lines. *Note that due to a PineScript limitation this list has longer timeframes than can be used with this indicator - I hope to resolve this in a future version.
[**]Price to Use - sets the "Source" of the price to use for the start price, standard options are: Open, High, Low, Close, hl2, hlc3, ohlc4, hlcc4. You can find a great definition of these sources here (I have no affiliation here, just found it a helpful resource).
[**]Near Guardrail Distance - the distance in chart units (dollars, etc.) from the delayed session start price for the first set of lines to be drawn (default is 80)
[**]Far Guardrail Distance - the distance in chart units (dollars, etc.) from the delayed session start price for the second set of lines to be drawn (default is 100)
Note: it occurs to me as I write this that either one could be farther or nearer to the money, so in a future version I will likely change these labels to Guardrail 1 and Guardrail 2, instead of near and far.
[**]Style Settings on Inputs page - I think these are self explanatory, so I will spare you additional reading
- CHANGES IN THIS VERSION:
- [**]Added Price to Use input
[**]Swapped default colors (by request of some friends, sorry if this confuses anyone)
This indicator will draw 5 price level lines on the chart each day, beginning at the first candle after a delay period specified by the user (default is 30 minutes from market open).
The lines are drawn at the specified price (open, high, low, close, etc.) from the first candle after the delay period (default is Open), and then at specified increments above and below that price level (defaults are 80 and 100).
USAGE:
- Determine the typical range of the underlying you are trading
- Determine the delay from market open you wish to use to set your range
- Set your parameters in the indicator settings
- Manage risk by trading inside or outside these parameters, depending on your trade strategy
Important note: This indicator is designed to be used on an intra-day chart only - eg. minutes, or hourly. It will give an error if used on a longer time-frame chart.
SETTINGS:
- Show Historical Data - Display only the current day's price lines for real-time use only, or show historical lines for additional analysis.
- Delay After Market Open - length of time, in ticks or minutes, to delay before setting the starting price for the price lines. *Note that due to a PineScript limitation this list has longer timeframes than can be used with this indicator - I hope to resolve this in a future version.
- Price to Use - sets the "Source" of the price to use for the start price, standard options are: Open, High, Low, Close, hl2, hlc3, ohlc4, hlcc4. You can find a great definition of these sources here (I have no affiliation here, just found it a helpful resource).
- Near Guardrail Distance - the distance in chart units (dollars, etc.) from the delayed session start price for the first set of lines to be drawn (default is 80)
- Far Guardrail Distance - the distance in chart units (dollars, etc.) from the delayed session start price for the second set of lines to be drawn (default is 100)
Note: it occurs to me as I write this that either one could be farther or nearer to the money, so in a future version I will likely change these labels to Guardrail 1 and Guardrail 2, instead of near and far. - Style Settings on Inputs page - I think these are self explanatory, so I will spare you additional reading
CHANGES IN THIS VERSION:
- Added Price to Use input
- Swapped default colors (by request of some friends, sorry if this confuses anyone)
- Tightened up code
- Updated documentation
- Fixed issue where price label overlapped lines when zoomed in on chart
- Renamed Near and Far Guardrails to Guardrail 1 and 2
- Changed Default color for Guardrail 2 to "aqua" (very similar) which is part of the default color set and thereby reduced some code
- Fixed an issue where lines were only drawn on the past ~10 days
- Added a vertical line at the start of the session with a control in settings to toggle it off or on
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.
Declinazione di responsabilità
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.