Brooks 18 Bars [KintsugiTrading]Brooks 18 Bars
Overview:
This indicator allows traders to specify a time frame within each trading day and plots lines at the highest and lowest prices recorded during that period. It is particularly useful for identifying key levels of support and resistance within a specified time range.
Features:
User-Defined Time Frame: Traders can input their desired start and end times in a 24-hour format, allowing flexibility to analyze different market sessions.
High and Low Price Levels: The indicator plots lines representing the highest and lowest prices observed within the specified time frame each day.
Clear Visual Representation: The high and low lines are color-coded for easy identification, with the high & low prices in Kintsugi Trading Gold.
How to Use:
Set the Time Frame:
Adjust the "Start Time Hour" and "Start Time Minute" to define the beginning of your desired time frame.
Adjust the "End Time Hour" and "End Time Minute" to define the end of your desired time frame.
Analyze Key Levels:
Al Brooks popularized the following idea and basis for creating this indicator:
On a 5-minute chart, Bar 1 has a 20-30% chance of being the High or Low of the day.
Bar 12 has a 50% chance.
Bar 18 has an 80-90% chance.
Use the plotted lines to identify significant support and resistance levels within your specified time frame. These levels can help inform your trading decisions, such as entry and exit points.
Good luck with your trading!
BARS
Candles ThemesGood morning,
Here is my first script as a pinecoder.
So I present to you my indicator: the “Candles Theme”.
Instead of searching for a long time in the chart settings to change the style of the chart, you can use this indicator which offers:
- 8 default themes.
- The ability to create a custom theme.
Themes :
- Pink - Blue : Dark and Light
- Classic : Dark and Light
- Blue - Orange Classic : Dark and Light
- Dark Monochrome : Only Dark
- Light Monochrome : Only Light
- Blue - Orange 2 : Light and Dark
- Pastel 1 : Light and Dark
- Pastel 2 : Only Light
Being a trader and PineScript developer, I often create scripts according to my needs like this, but this is the first time I have published it.
If you have any questions or suggestions for improvement, please let me know in the comments.
End
Inside Bars (Multiple / Consecutive)Description
When an inside bar is found, the indicator remembers the high and low (= range) of the candle before the inside bar.
As long as price moves within the range, every bar is highlighted as an inside bar to the range.
Purpose
The indicator can assist when identifying valid pullbacks and buy-side liquidity (BSL) / sell-side liquidity (SSL).
Williams Vix Fix OHLC candles plot indicator (Tartigradia)OHLC candles plot of the Williams VixFix indicator, which allows to draw trend lines.
Williams VixFix is a realized volatility indicator developed by Larry Williams, and can help in finding market bottoms.
Indeed, as Williams describe in his paper, markets tend to find the lowest prices during times of highest volatility, which usually accompany times of highest fear. The VixFix is calculated as how much the current low price statistically deviates from the maximum within a given look-back period.
The Williams VixFix indicator is usually presented as a curve or histogram. The novelty of this indicator is to present the data as a OHLC candles plot: whereas the original Williams VixFix calculation only involves the close value, we here use the open, high and low values as well. This led to some mathematical challenges because some of these calculations led to absurd values, so workarounds had to be found, but in the end I think the result was worth it, it reproduces the VIX chart quite well.
A great additional value of the OHLC chart is that it shows not just the close value, but all the values during the session: open, high and low in addition to close. This allows to draw trend lines and can provide additional information on momentum and sentiment. In addition, other indicators can be used on it, as if it was a price chart, such as RSI indicators (see RSI+ (alt) indicator for example).
For more information on the Vix Fix, which is a strategy published under public domain:
The VIX Fix, Larry Williams, Active Trader magazine, December 2007, web.archive.org
Fixing the VIX: An Indicator to Beat Fear, Amber Hestla-Barnhart, Journal of Technical Analysis, March 13, 2015, ssrn.com
Replicating the CBOE VIX using a synthetic volatility index trading algorithm, Dayne Cary and Gary van Vuuren, Cogent Economics & Finance, Volume 7, 2019, Issue 1, doi.org
This indicator includes only the Williams VixFix as an OHLC candles or bars plot, and price / vixfix candles plot, as well as the typical vixfix histogram. Indeed, it is much more practical for unbounded range indicators to be plotted in their own separate panel, hence why this indicator is released separately, so that it can work and be scaled adequately out of the box.
Note that the there are however no bottom buy signals. For a more complete indicator, which also includes the OHLC candles plots present here, but also bottom signals and Inverse VixFix (top signals), see:
Set Index symbol to SPX, and index_current = false, and timeframe Weekly, to reproduce the original VIX as close as possible by the VIXFIX (use the Add Symbol option, because you want to plot CBOE:VIX on the same timeframe as the current chart, which may include extended session / weekends). With the Weekly timeframe, off days / extended session days should not change much, but with lower timeframes this is important, because nights and weekends can change how the graph appears and seemingly make them different because of timing misalignment when in reality they are not when properly aligned.
NumberOfVisibleBarsLibrary "NumberOfVisibleBars"
This library calculates the number of visible bars on the user screen
NumberOfVisibleBars(No)
Calculates the number of visible bars on the user screen
Parameters:
No : paramters needed
Returns: The numbers of visible bars on the user screen (int)
Market Sessions Day & Candles JRA V2.0Market Sessions Day & Candles JRA V2.0
This indicator will allow you to:
- Create boxes for the Market Hours for:
'♯1 SESSION TOKYO'
'♯2 SESSION LONDON'
'♯3 SESSION NEW YORK'
You will be able to change the Hours depending your TimeFrame
You will be able to extend the boxes for the Market Hours and Have Fibonacci Levels on it.
- With every one of it you can change the style of Box for the Market Hours
- You can show Labels for the Market hours as well other options like Price or Pips
- Show the Candles for the TimeFrames depending your settings
- You can change the Candles settings to be Candle or Bar
- Candle Resolution on Timeframe
-Maximum candles to Display
-Show or Unshown Timeframes Candles
-Change colors on candles
Every option has a Tip to understand the function to it
Extreme Bars"Extreme Bars" is a simple but useful indicator that marks overbought and oversold candles. This indicator paints candles that fall far above the average red, and the candles that rise above the average green. Of course, they can change these colors if they want. "Extreme Bars" can be interpreted in many different ways. The starting points of colored candles can often be good support or resistance. In addition, it would be wise to close the positions opposite the colored candles and to maintain the positions compatible with the colored candles. It is also possible that the gaps formed by the colored candles will be closed in the future. The sensitivity of the indicator can be changed in the settings section.
VisibleChart█ OVERVIEW
This library is a Pine programmer’s tool containing functions that return values calculated from the range of visible bars on the chart.
This is now possible in Pine Script™ thanks to the recently-released chart.left_visible_bar_time and chart.right_visible_bar_time built-ins, which return the opening time of the leftmost and rightmost bars on the chart. These values update as traders scroll or zoom their charts, which gives way to a class of indicators that can dynamically recalculate and draw visuals on visible bars only, as users scroll or zoom their charts. We hope this library's functions help you make the most of the world of possibilities these new built-ins provide for Pine scripts.
For an example of a script using this library, have a look at the Chart VWAP indicator.
█ CONCEPTS
Chart properties
The new chart.left_visible_bar_time and chart.right_visible_bar_time variables return the opening time of the leftmost and rightmost bars on the chart. They are only two of many new built-ins in the `chart.*` namespace. See this blog post for more information, or look them up by typing "chart." in the Pine Script™ Reference Manual .
Dynamic recalculation of scripts on visible bars
Any script using chart.left_visible_bar_time or chart.right_visible_bar_time acquires a unique property, which triggers its recalculation when traders scroll or zoom their charts in such a way that the range of visible bars on the chart changes. This library's functions use the two recent built-ins to derive various values from the range of visible bars.
Designing your scripts for dynamic recalculation
For the library's functions to work correctly, they must be called on every bar. For reliable results, assign their results to global variables and then use the variables locally where needed — not the raw function calls.
Some functions like `barIsVisible()` or `open()` will return a value starting on the leftmost visible bar. Others such as `high()` or `low()` will also return a value starting on the leftmost visible bar, but their correct value can only be known on the rightmost visible bar, after all visible bars have been analyzed by the script.
You can plot values as the script executes on visible bars, but efficient code will, when possible, create resource-intensive labels, lines or tables only once in the global scope using var , and then use the setter functions to modify their properties on the last bar only. The example code included in this library uses this method.
Keep in mind that when your script uses chart.left_visible_bar_time or chart.right_visible_bar_time , your script will recalculate on all bars each time the user scrolls or zooms their chart. To provide script users with the best experience you should strive to keep calculations to a minimum and use efficient code so that traders are not always waiting for your script to recalculate every time they scroll or zoom their chart.
Another aspect to consider is the fact that the rightmost visible bar will not always be the last bar in the dataset. When script users scroll back in time, a large portion of the time series the script calculates on may be situated after the rightmost visible bar. We can never assume the rightmost visible bar is also the last bar of the time series. Use `barIsVisible()` to restrict calculations to visible bars, but also consider that your script can continue to execute past them.
Look first. Then leap.
█ FUNCTIONS
The library contains the following functions:
barIsVisible()
Condition to determine if a given bar is within the users visible time range.
Returns: (bool) True if the the calling bar is between the `chart.left_visible_bar_time` and the `chart.right_visible_bar_time`.
high()
Determines the value of the highest `high` in visible bars.
Returns: (float) The maximum high value of visible chart bars.
highBarIndex()
Determines the `bar_index` of the highest `high` in visible bars.
Returns: (int) The `bar_index` of the `high()`.
highBarTime()
Determines the bar time of the highest `high` in visible bars.
Returns: (int) The `time` of the `high()`.
low()
Determines the value of the lowest `low` in visible bars.
Returns: (float) The minimum low value of visible chart bars.
lowBarIndex()
Determines the `bar_index` of the lowest `low` in visible bars.
Returns: (int) The `bar_index` of the `low()`.
lowBarTime()
Determines the bar time of the lowest `low` in visible bars.
Returns: (int) The `time` of the `low()`.
open()
Determines the value of the opening price in the visible chart time range.
Returns: (float) The `open` of the leftmost visible chart bar.
close()
Determines the value of the closing price in the visible chart time range.
Returns: (float) The `close` of the rightmost visible chart bar.
leftBarIndex()
Determines the `bar_index` of the leftmost visible chart bar.
Returns: (int) A `bar_index`.
rightBarIndex()
Determines the `bar_index` of the rightmost visible chart bar.
Returns: (int) A `bar_index`
bars()
Determines the number of visible chart bars.
Returns: (int) The number of bars.
volume()
Determines the sum of volume of all visible chart bars.
Returns: (float) The cumulative sum of volume.
ohlcv()
Determines the open, high, low, close, and volume sum of the visible bar time range.
Returns: ( ) A tuple of the OHLCV values for the visible chart bars. Example: open is chart left, high is the highest visible high, etc.
chartYPct(pct)
Determines a price level as a percentage of the visible bar price range, which depends on the chart's top/bottom margins in "Settings/Appearance".
Parameters:
pct : (series float) Percentage of the visible price range (50 is 50%). Negative values are allowed.
Returns: (float) A price level equal to the `pct` of the price range between the high and low of visible chart bars. Example: 50 is halfway between the visible high and low.
chartXTimePct(pct)
Determines a time as a percentage of the visible bar time range.
Parameters:
pct : (series float) Percentage of the visible time range (50 is 50%). Negative values are allowed.
Returns: (float) A time in UNIX format equal to the `pct` of the time range from the `chart.left_visible_bar_time` to the `chart.right_visible_bar_time`. Example: 50 is halfway from the leftmost visible bar to the rightmost.
chartXIndexPct(pct)
Determines a `bar_index` as a percentage of the visible bar time range.
Parameters:
pct : (series float) Percentage of the visible time range (50 is 50%). Negative values are allowed.
Returns: (float) A time in UNIX format equal to the `pct` of the time range from the `chart.left_visible_bar_time` to the `chart.right_visible_bar_time`. Example: 50 is halfway from the leftmost visible bar to the rightmost.
whenVisible(src, whenCond, length)
Creates an array containing the `length` last `src` values where `whenCond` is true for visible chart bars.
Parameters:
src : (series int/float) The source of the values to be included.
whenCond : (series bool) The condition determining which values are included. Optional. The default is `true`.
length : (simple int) The number of last values to return. Optional. The default is all values.
Returns: (float ) The array ID of the accumulated `src` values.
avg(src)
Gathers values of the source over visible chart bars and averages them.
Parameters:
src : (series int/float) The source of the values to be averaged. Optional. Default is `close`.
Returns: (float) A cumulative average of values for the visible time range.
median(src)
Calculates the median of a source over visible chart bars.
Parameters:
src : (series int/float) The source of the values. Optional. Default is `close`.
Returns: (float) The median of the `src` for the visible time range.
vVwap(src)
Calculates a volume-weighted average for visible chart bars.
Parameters:
src : (series int/float) Source used for the VWAP calculation. Optional. Default is `hlc3`.
Returns: (float) The VWAP for the visible time range.
Bar Count for BacktestingHello!
Not much special about this script; you can use date & time, or bar count, to ascertain the number of bars in a time period for backtesting.
This script can be used in conjunction with large scripts incorporating complex intricacies that won't load on 20,000+ bar data sets.
If your script's load time transcends the TV allotted load time - use this script to quickly determine the number of bars in the data set.
Through trial & error you should be able to determine the approximate number of bars your script can execute on without exceeding the imposed time limit!
The image above shows a user-defined time window and, consequently, the script returns the number of bars that constitute the time period.
You can drag the white vertical lines to efficiently configure the calculated time period.
The image above shows functionality for the "Bars Back" feature.
Enjoy!
[FR]Custom Candles/FVG/nSideBarCustom Candles /FVG/ nSideBar
- I used this as a learning project for understanding plot()'s Better
- My goal was to see if I could use normal plots to cleanly plot FVGs on the chart using only plots with out and boxes/lines
The problem was if multiple FVGs were on back to back bars the plot fill would fill the line to the next FVG/Bar
I solved this by using 4 plots and alternating them if consecutive FVGs form
- 2 MODES
- Slim
- Normal
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-Slim
Uses 3 plotcandle() parts and divides the candle between body/wicks/open and close
by manipulating the ohlc inputs and the colors I was able to pretty make them full customizable
all components are customizable with up/down colors
-Normal
These are your normal candles but they are full customize able from components to individual up/down colors
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- FVGs
There are 2 FVG settings can be used with both MODES
- Big
These are the FVGs that use plots and since there isn't a 500 object limit on plots you don't need to manage them in the code and they are there how ever far you need to look back
- Slim
These use a Line and the width of the line can be adjusted for user preferences
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- INSIDE-BARS
These will change the color of the body of either SLIM or NORMAL Candles
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Drawing Snap Features Work Just Fine!
I suggest hiding your chart candles with the eye in the top left of the screen and moving the indicator to the top of your object tree
I understand that the candles in the chart pictures are impractical I was just demonstrating the functionality of the tool
Hope You Enjoy!!
FFriZz
FiboBars ExtendedA trend indicator FiboBars Extended , the main purpose of which is to confirm the trend and cut off market noise. In his logic, he uses the Fibonacci sequence.
Two settings are used to account for noise suppression accuracy:
Period - number of calculation bars
Level - Fibonacci number selection
Last Available Bar InfoLibrary "Last_Available_Bar_Info"
getLastBarTimeStamp()
getAvailableBars()
This simple library is built with an aim of getting the last available bar information for the chart. This returns a constant value that doesn't change on bar change.
For backtesting with accurate results on non standard charts, it will be helpful. (Especially if you are using non standard charts like Renko Chart).
Methods
getLastBarTimeStamp()
: Returns Timestamp of the last available bar (Constant)
getAvailableBars()
:Returns Number of Available Bars on the chart (Constant)
Example
import paragjyoti2012/Last_Available_Bar_Info/v1 as LastBarInfo
last_bar_timestamp=LastBarInfo.getLastBarTimeStamp()
no_of_bars=LastBarInfo.getAvailableBars()
If you are using Renko Charts, for backtesting, it's necesary to filter out the historical bars that are not of this timeframe.
In Renko charts, once the available bars of the current timeframe (based on your Tradingview active plan) are exhausted,
previous bars are filled in with historical bars of higher timeframe. Which is detrimental for backtesting, and it leads to unrealistic results.
To get the actual number of bars available of that timeframe, you should use this security function to get the timestamp for the last (real) bar available.
tf=timeframe.period
real_available_bars = request.security(syminfo.ticker, tf , LastBarInfo.getAvailableBars() , lookahead = barmerge.lookahead_off)
last_available_bar_timestamp = request.security(syminfo.ticker, tf , LastBarInfo.getLastBarTimeStamp() , lookahead = barmerge.lookahead_off)
CH-I: Trend - Higher Timeframe BodyI took the script for the built-in indicator for candle bodies of a higher timeframe (www.tradingview.com) which has a fixed border width and style and added the possibility to customize both the border width and the border style or to even disable the display of any border at all, which makes the presentation of those boxes more flexible.
Ultimate Volatility Indicator [CC]The Ultimate Volatility Indicator was created by Richard Poster (Stocks and Commodities July 2021 pg 21) and this is a very simple but effective indicator. The idea behind volatility indicators is that when the indicator rises above a certain threshold then volatility is high enough and you can make a good amount of money riding the trend in the current direction and then exit when volatility drops below the threshold or until the underlying trend changes.
I have included a threshold that you can change from the default but I would recommend trying out different values to see what works best for you. This indicator will let you know as soon as volatility increases and reacts very quickly. I have included strong buy and sell signals in addition to normal ones so darker colors are strong buy and sell signals and lighter colors are normal signals. Buy when the line turns green and sell when it turns red.
Please let me know if you would like to see me publish any other indicators!
Candle Volatilty IndicatorThis script helps to get a better view on the volatility of the price.
Each bar represents the high and low of the candle calculated derived from the open price.
It can help to get an insight on the volatility .
Tick RenkoTick Renko, bars are formed on live chart.
note:there is a issue that creates artifacts while there is not enough history loaded.
Volume BarsVolume Sato's Bar / Satos Bar / Raio X Preditivo
This is an experimental code based on Satos Bar by Raio X Preditivo
It's a way to check expressive volume in one bar, and it's can give you an idea of a important Zones to make decisions.
Example:
Multi-time-Frame number of days in the chartHelps to see the number of days in any default timeframe chart. (Not yet tested with custom time frames!)
Please like and favorite this script if you like it!
Any donations of tradingview coins to help me buy a tradingview pro membership would also be highly appreciated! Thank you!
Volume Bars and Regions of InterestThe bars are colored according to the volume traded. The volume weights were distributed logically for a better analysis.
<0.666 low volume
0.666 to 1.333 median volume
1,333 to 2,666 high volume
> 2,666 'institutional' volume
The moving average bands are the average of the highs and lows. They show a region of interest and not just a 'line'.
Candles for VSACandles in which the open is equal to the previous close. (For VSA theory)
Свечи в которых открытие равно предыдущему закрытию. (Сделано для анализа по ВСА).
FUNCTION: Specify lengths in time (or bars) This is a function to give measures in time rather than bars...
I often want to measure in things in time rather than bars and change the sample rate (the candle size)
without reconfiguring my settings. This is a handy function for setting you input lengths in time units
(or bars when you want that)
For example
I want a 3 hour moving average, regardless of whether I have 5 minute candles or 30 min candles...
I want a 200 day moving average, regardless of whether I have 1 day or 1 week candles...
This is designed for you to put in your own scripts for your own purpose, but you can use this as is for time constant moving averages
or as an indicator on an indicator.
This shows the same moving averages 45 min / 3 hours in aqua / fuchsia and 1 day / 1 week in red / green
First row: On an extended session chart with 10m, 30m and 60m candles (all of them use the same settings (day length is 16 hours) everything else default.
Second row: On a standard session chart with 10m, 30m and 60m candles (all of them use the same settings everything else default.